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

TemplateRef not working with Tab


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); 

Live Chat Icon For mobile
Up arrow icon