I created two fieldsets, one is outside the ng-template and the other is inside of the splitter primeng components.
For the outside,the fieldset can be collapsed/expanded while those inside cannot. It's probably because I can't trigger event click inside the ng-template.
Pls find my code as below : text
Can anyone help ?
You are querying the document for the
fieldset, but you have two of those. Introduceidattribute to your fieldsets, then do the same thing for each fieldset.Put
ids to array:indexes: string[] = ['fieldset1', 'fieldset2'];and add to eachfieldsettheiridattribute, like<fieldset [id]="indexes[0]">and<fieldset [id]="indexes[1]">, then change yourngAfterViewInit()method to iterate overindexesarray, using each value forgetElementByIdselector:Your edited stackblitz code.