DEV Community


Discussion on: Angular accordion working demo

seanperkins profile image
Sean Perkins

Using jQuery isn't the move with Angular. You could improve this accordion by using Angular components to break up the different functional aspects of an accordion.

Also, if you are needing to look up elements (which a componentized accordion wouldn't need), the use of ViewChild is highly recommended.

The title is a little misleading, as you aren't using anything Angular with regards to the accordion, just inserting non-Angular specific code into an app component. Would love to see you adapt this to use Angular's recommended practices to avoid misleading individuals against best practices.

Would be happy to help point you in the right direction if you're curious!

ajaydeveloper profile image
AjayMalhotra Author

Yes you are right and thank you.