DIY expansible/collapsible list in Angular

J Rui Pinto
Dec 2, 2018

The concept behind this is a list that displays 1 property of every object in an object array and when you click in a row of the list, it will expand and show the remaining proprerties of the corresponding object.

This is list optimal to present JSON data that you received from your backend.

Requesits: Very basic knowledge of Angular2+, TypeScript and HTML

To use this list in your projects you just need to:

  1. Look at the /src/app/expansible-list component
  2. Copy the expandOrColapseRow() funtion to your project
  3. Copy the corresponding html
  4. Adapt all of the above to your project

If you have any questions, don’t understand any concept in the code or find any typo, please comment.

If you liked the explanation, you can find more interesting articles at https://medium.com/boring-notebook

--

--

J Rui Pinto
0 Followers

I am a self-taught Angular Developer specialized in RxJS and electronics. I mostly write technical reminders but I’m happy if they help you too.