我正在尝试将插值标题绑定到angular2的kendo标签中,但我的代码无效。
*没有插值的代码,tist工作正常,但插值不起作用!
<kendo-tabstrip>
<kendo-tabstrip-tab **[title]="'Paris'" ** [selected]="true">
<ng-template kendoTabContent>
</ng-template>
</kendo-tabstrip-tab>
<kendo-tabstrip-tab **[title]="'New York City'" **>
<ng-template kendoTabContent>
</ng-template>
</kendo-tabstrip-tab>
<kendo-tabstrip-tab [title]="'Tallinn'">
<ng-template kendoTabContent>
</ng-template>
</kendo-tabstrip-tab>
<kendo-tabstrip-tab [title]="'Sydney'" [disabled]="true"></kendo-tabstrip-tab>
</kendo-tabstrip>
硬编码数据:
public cities=[
{"city":"Paris"},
{"city":"London"}
]
试用代码:
<kendo-tabstrip>
<kendo-tabstrip-tab [title]="item.city" [selected]="true" *ngFor="let item of cities">
<ng-template kendoTabContent>
</ng-template>
</kendo-tabstrip-tab>
<kendo-tabstrip>
谢谢
答案 0 :(得分:0)
试试:* ngFor =“让城市的项目”&gt;
答案 1 :(得分:0)
我正在使用此代码,它对我有用:
<kendo-tabstrip (tabSelect)="onTabSelected($event)">
<kendo-tabstrip-tab *ngFor="let tab of tabs;" [title]="'title ' + tab.title)" [selected]="tab.isSelected">
<ng-template kendoTabContent>
// your tab content
</ng-template>
</kendo-tabstrip-tab>
</kendo-tabstrip>`