我正在使用Ionic2,并具有和ion-content
标记。根据变量,我想更改标签上的样式。
我已经尝试了以下方法,但是它不起作用:
<ion-content *ngIf="persoModel.type === 0" padding class="person-content-wanted">
<ion-content *ngIf="personModel.type === 1" padding class="person-content-offered">
...
</ion-content>
任何人都可以提出一种实现此目标的方法吗?
谢谢
这personModel
是一个布尔值,如果为true,则将获得person-content-wanted
课程;如果为false,则将为您获取课程person-content-offerred
<ion-content [class]="personModel? 'person-content-wanted' : 'person-content-offered'">
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句