【发布时间】:2018-04-02 03:12:34
【问题描述】:
目前我正在做一些家庭项目并学习离子。我是一名 php 开发人员,正在转向 Ionic。
所以基本上我在 Ionic 项目中使用 php 概念,现在我坚持使用 ngIf 条件。
我有一个显示用户信息的个人资料页面。 条件1:如果用户没有设置他们的卡详细信息,我想显示添加卡按钮
条件 2:如果卡片详细信息已经设置,我想显示编辑卡片按钮并隐藏添加卡片按钮。
这里是 HTML 视图。
<ion-row *ngFor="let c of card | async">
<img src="assets/imgs/{{c.cardtype}}.png" width="100%" height="30px">
<button ion-button (click)="editCard(c)" clear color="core" class="text">Edit Card</button>
</ion-row>
<ion-row >
<button ion-button (click)="addCard()" clear color="core" class="text">Add Card</button>
<img src="http://placehold.it/200x100" width="100%" height="30px">
</ion-row>
谢谢。
【问题讨论】:
标签: angular ionic-framework angular-ng-if