【发布时间】:2016-10-26 16:37:12
【问题描述】:
您好,我刚开始在我的项目中使用 ionic 2,如何更新 ionic 2 中的 ui 值?只是当我们单击按钮时,一些文本发生了变化。我试过了,但没有用
home.ts
@Component({
templateUrl: 'build/pages/home/home.html'
})
export class HomePage {
public test: any;
constructor(private nav: NavController) {
}
update(){
this.test = "updated text";
}
}
home.html
<ion-content>
<p>{{test}}</p>
<button (click)="update()">update</button>
</ion-content>
请帮忙,谢谢!
【问题讨论】:
标签: ionic-framework angular ionic2