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. Image for the cookie policy date
close icon

Tab and Accordin not working

Hello
I have a Tab control and would like to add an Accordion control. When I do this, none of the onscreen controls appear.

Sample Code:
<ejs-tab id = "tabDefault">
            <e-tabitems>
                <e-tabitem>
                    <ng-template #headerText>
                        <div> General Data </div>
                    </ng-template>
                    <ng-template #content>
                        <br />
                        HTML
                    </ng-template>
                </e-tabitem>
                <e-tabitem>
                    <ng-template #headerText>
                        <div> Address </div>
                    </ng-template>
                    <ng-template #content>
                        <br />
                        HTML
                    </ng-template>
                </e-tabitem>
                <e-tabitem * ngIf = "edition">
                        <ng-template #headerText>
                            <div> Photos </div>
                        </ng-template>
                        <ng-template #content>
                            <br />
                            
                            <ejs-accordion>
                                    <e-accordionitems>
                                      <e-accordionitem expanded = 'false'>
                                        <ng-template #header>
                                          <div> Add Photo </div>
                                        </ng-template>
                                        <ng-template #content>
                                            HTML
                                        </ng-template>
                                      </e-accordionitem>
                                    </e-accordionitems>
                            </ejs-accordion>
                            
                        </ng-template>
                </e-tabitem>
                <e-tabitem * ngIf = "edition">
                        <ng-template #headerText>
                            <div> Locks </div>
                        </ng-template>
                        <ng-template #content>
                            <br />
                            
                        </ng-template>
                </e-tabitem>
            </e-tabitems>
        </ejs-tab>

Without Accordion


With Accordion


3 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team August 13, 2019 08:58 AM UTC

Hi LUCIANO, 
 
Syncfusion greetings. 
 
We could reproduce the reported issue while rendering the Accordion with template inside the Tab content template. Kindly use the below code example to overcome the issue. 
 
<e-tabitem [header]='headerText[0]' [content]="content1"></e-tabitem> 
 
<ng-template #content1 let-data> 
      <ejs-accordion> 
        <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 services. </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, the view, and the controller. 
              </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.</div> 
            </ng-template> 
          </e-accordionitem> 
        </e-accordionitems> 
      </ejs-accordion> 
    </ng-template> 
 
Regards, 
Karthi 



LA LUCIANO ALMEIDA PIMENTA August 13, 2019 10:50 AM UTC

Thank you!!!!!


KK Karthigeyan Krishnamurthi Syncfusion Team August 14, 2019 03:36 AM UTC

Most welcome 😊 


Loader.
Live Chat Icon For mobile
Up arrow icon