【发布时间】:2017-10-15 01:21:07
【问题描述】:
我有一个子组件不会触发*ngIf 的条件
子组件:
export class child {
@Input() user;
@Input() list;
listLength: number;
showBtn: boolean = false;
constructor(){}
ngOnChanges(changes: SimpleChanges){
this.userId = this.user.id;
this.userList = this.list;
this.listLength = this.userList.length; // this updates everytime when changes happen on another component thats pushed from this component.
if (this.listLength > 3){ // this doesn't fire until I refresh the page
this.showBtn = true;
}
【问题讨论】:
-
你能记录
listLength的值吗?
标签: angular ionic2 angular2-template ionic3