【发布时间】:2019-12-03 14:23:30
【问题描述】:
我有这个变量控制对话框是否显示,它在第一次工作,但在第二次不工作,发出执行但不再调用接收函数。
父类:
isLogin :boolean ;
constructor(...){
this.isLogin = false;
}
receiveNotification(notification: boolean): void {
this.isLogin = notification;
}
父 html:
<login-dialog *ngIf="!isLogin" name="{{name}}" (notify)="receiveNotification($event)"></login-dialog>
在子类中: 我有一个函数,当触发调用发出和发出确实被调用时,它不会第二次触发父级上的函数
@Output() notify = new EventEmitter<any>();
exampleFunction(){
this.notify.emit(true);
}
我认为这可能与 ngIf 相关,但不确定,这里有什么问题?
【问题讨论】:
标签: angular typescript events dialog angular-event-emitter