Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

First panel open on init with custom accordion-angular

I created a library with a custom accordion in angular with bind event for auto close when other panel is clicked in "Toggle", my problem is that I need the first panel open at start by default.

here is a stackblitz with the code:

https://stackblitz.com/edit/angular-ivy-dbztkc?file=src/app/app.module.ts

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I tried to bind other event but I can´t figure how bind that event to my previous one without breaking things, try a custom directive, and some commands on init, nothing works

I want this at start:
How should start

thank you for your help in advance.

>Solution :

Just add a initial value to activeTitle

 activeTitle: string = 'Documento 1';

Demo

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading