问题描述
我在项目中添加了 ngzorro 消息框,我想知道如何在页面加载时不使用点击事件的情况下打开该消息框
在这里编码
commonlayout.html
<router-outlet (load)="createBasicNotification()">
</router-outlet>
.ts
createBasicNotification(): void {
this.notification.blank(
'Notification Title','I will never close automatically. I will be close automatically. I will never close automatically.',{ nzDuration: 0 }
);
}
解决方法
我已解决问题
我将ngOnInit
添加到了
`ngOnInit() { `this.createBasicNotification() ; true;`}`