1.<ng-container *ngIf=”user.length>=3″>”
<button ion-button *ngFor=”let userinfo of user” [style.color]=”‘red'” [ngStyle]=”{‘background-color’:’white’,’font-size.em’:3}” >{{userinfo.id}},{{userinfo.name}}
</button>
</ng-container>//可以用style或者[ngStyle]来设置属性,<ng-container>可以用来做条件嵌套。
2.https://segmentfault.com/a/1190000005030594
3.<ion-item [ngSwitch]=”name”>
<ion-label *ngSwitchCase=”sex1″>
sex is girl
</ion-label>
<ion-label *ngSwitchCase=”sex2″>
sex is boy
</ion-label>
<ion-label *ngSwitchDefault>
sex is none
</ion-label>
</ion-item >
ngSwitch中“name”,“sex1”,”sex2″都必须是ts中定义的变量名(该变量值可以被修改)。