I want to create tabstrip and append inside tab when i click from left menu. I created all my components and use this components as an Content of dynamic tabs.
Is it possible with kendo Angular Tabstrip Layout?
Thanks
You can using the built-in ngFor to have the component's template loop over a collection variable defined on the component to dynamically show the tabs.
Take a look at this example. If you were to add or remove from the tabs variable, it will dynamically be reflected in the DOM.
Component's Template:
<kendo-tabstrip>
<kendo-tabstrip-tab *ngFor="let tab of tabs; let first = first" [title]="tab.header" [selected]="first">
<ng-template kendoTabContent>
<div class="content">
<img [src]="tab.body.image" />
<h2>{{ tab.body.degrees }}<span>ºC</span></h2>
<span>{{ tab.body.description }}</span>
</div>
</ng-template>
</kendo-tabstrip-tab>
</kendo-tabstrip>
Variable Declared in Component:
tabs = [
{
header: 'Paris',
body: {
image:
'https://www.telerik.com/kendo-angular-ui-develop/components/layout/assets/tabstrip/rainy.png',
degrees: '17',
description: 'Rainy weather in Paris.',
},
},
{
header: 'New York City',
body: {
image:
'https://www.telerik.com/kendo-angular-ui-develop/components/layout/assets/tabstrip/cloudy.png',
degrees: '19',
description: 'Cloudy weather in New York City.',
},
},
{
header: 'Tallinn',
body: {
image:
'https://www.telerik.com/kendo-angular-ui-develop/components/layout/assets/tabstrip/sunny.png',
degrees: '23',
description: 'Sunny weather in Tallinn.',
},
},
{
header: 'London',
body: {
image:
'https://www.telerik.com/kendo-angular-ui-develop/components/layout/assets/tabstrip/rainy.png',
degrees: '16',
description: 'Rainy weather in London.',
},
},
];
Stackblitz: https://stackblitz.com/edit/angular-iwwkxv