0
ng-class指令不能編譯,在檢查器中運行時可見。Ang-ng類不能編譯/工作
TS腳本
export class TotalPage {
showClass: boolean;
constructor(public navCtrl: NavController ,public http: Http) {
this.showClass = false;
}
}
HTML
<ion-header>
<ion-navbar>
<ion-title>Total</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<div ng-class="{expenceBg:showclass}">Test</div>
</ion-content>
SCSS
$expence-bg: #ffcccc;
$income-bg: #00cccc;
page-total {
.expenceBg{
background-color: $expence-bg;
}
.incomeBg{
background-color: $income-bg;
}
}
.expenceBg{
background-color: $expence-bg;
}
所以,當我運行它,它有測試因此它不會是 「NG」 級部分編譯。我究竟做錯了什麼?
嘗試[ngClass] =「{expenceBg:showclass}」' – SaiUnique