[ngClass]=...
の代わりに*ngClass
。
*
たとえば、以下を使用できる構造ディレクティブの省略構文のみです。
<div *ngFor="let item of items">{{item}}</div>
同等の長いバージョンの代わりに
<template ngFor let-item [ngForOf]="items">
<div>{{item}}</div>
</template>
https://angular.io/docs/ts/latest/api/common/index/NgClass-directive.htmlも参照してください。
<some-element [ngClass]="'first second'">...</some-element>
<some-element [ngClass]="['first', 'second']">...</some-element>
<some-element [ngClass]="{'first': true, 'second': true, 'third': false}">...</some-element>
<some-element [ngClass]="stringExp|arrayExp|objExp">...</some-element>
<some-element [ngClass]="{'class1 class2 class3' : true}">...</some-element>
https://angular.io/docs/ts/latest/guide/template-syntax.htmlも参照してください。
<!-- toggle the "special" class on/off with a property -->
<div [class.special]="isSpecial">The class binding is special</div>
<!-- binding to `class.special` trumps the class attribute -->
<div class="special"
[class.special]="!isSpecial">This one is not so special</div>
<!-- reset/override all class names with a binding -->
<div class="bad curly special"
[class]="badCurly">Bad curly</div>