We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dynamic Accordion header and content templates

Thread ID:





143081 Mar 4,2019 12:36 PM UTC Mar 5,2019 11:05 AM UTC Angular - EJ 2 1
Tags: Accordion
Asked On March 4, 2019 12:36 PM UTC


Is it possible to set values dynamically to header templates and content templates?

I have accordion:

<ejs-accordion #acrdnInstance (expanding)="expanding($event)">
<e-accordionitem expanded='true' [header]="header" [content]='content' cssClass="e-custom">

My templates:

<ng-template #header>
<p id="text">TextValueToInsert2</p>

<ng-template #content>
<div id="nested_accordion"></div>

Br Volodymyr

Karthigeyan Krishnamurthi [Syncfusion]
Replied On March 5, 2019 11:05 AM UTC

Thanks for contacting Syncfusion support.   
Yes, it is possible and kindly add the item as item model using the addItem public method to achieve your requirement. Please find the below code snippet for more reference.  
public clicktoadd(e) {  
    // give the item as item model with header and content property   
    var items = { header: 'NewHeader', content: 'NewContentAdded' };   
    this.acrdnInstance.addItem(items); // add the item using addItem  
We have also prepared a sample for your reference below.    



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon