我有這樣的月數列表:是否有可能有很多情況下ngIF在角2模板
months = ['1','2','3'...etc]
而且我itterate在數組中的模板:
<table *ngFor="let month of allMonthChannel" >
<months *ngIf =" something "></months>
</table>
問題是如何我可以顯示我的月份組件時,月份值只有像3,6,9,12。我應該把什麼,而不是「東西」? 感謝答案和索裏,我的英語:)
您是在尋找https://angular.io/docs/ts/latest/api/common/index/NgSwitch-directive.html? –