TemplateRef not working with Tab

Hello,

I am trying to repeat the HowTo example Adding dynamic items with content reuse but getting an error:

error TS2345: Argument of type '{ header: { text: string; }; content: TemplateRef<any>; }[]' is not assignable to parameter of type 'TabItemModel[]'.


1 Reply

KK Karthigeyan Krishnamurthi Syncfusion Team October 14, 2019 09:56 AM UTC

 
Syncfusion greetings. 
 
Kindly use the below code example to overcome the issue. 
 
public btnClicked(e: any): void { 
    let newtabItem: any = [ 
      { 
        header: { text: "DynamicTabItem" }, 
        content: this.DropDowntemplate 
      } 
    ]; 
    this.tabObj.addTab(newtabItem, 1); 
  } 
 
 
Regards, 
Karthi 
 


Loader.
Up arrow icon