Hi Sebastian,
Sorry for the inconvenience.
We were able to reproduce the reported issue and this is because the Accordion elements will not be compiled and available in DOM for processing in the NgAfterViewInit lifecycle hook and thus you were unable to hide the items using hideItem method.
However, you can achieve this requirement in the created event of Accordion as given in the below code.
[HTML]
<ejs-accordion #acc (created)="hideAcc()">
<e-accordionitems>
<e-accordionitem expanded='true'>
<ng-template #header>
<div>ASP.NET</div>
</ng-template>
<ng-template #content>
<div>Microsoft ASP.NET is a set of technologies in the Microsoft .NET Framework for building Web applications and XML Web
</div>
</ng-template>
</e-accordionitem>
<e-accordionitem>
<ng-template #header>
<div>ASP.NET MVC</div>
</ng-template>
<ng-template #content>
<div>The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model,
</div>
</ng-template>
</e-accordionitem>
<e-accordionitem>
<ng-template #header>
<div>JavaScript</div>
</ng-template>
<ng-template #content>
<div>JavaScript (JS) is an interpreted computer programming language.It was originally implemented as part of web browsers
</div>
</ng-template>
</e-accordionitem>
</e-accordionitems>
</ejs-accordion>
[TS]
constructor(private route: ActivatedRoute) {
this.sub = this.route.params.subscribe(params => {
this.hideItem = +params['id']; // save the route param in a private variable
});
}
hideAcc(){
if(this.hideItem == 5) // check the routeparam in the created event of Accordion item to hide items
this.accordion.hideItem(0,true)
}
}
We have edited the sample as per our suggestion. Please check and get back to us if you have any further concerns.
Regards,
Deepa L.