我正在使用NG-ZORRO通知
我有一个角度代码
this.notif = this.notification.create(
'success',
'Notification',
'test message'
);
我找不到像
.close()
这样的API
但是通知显示了 4 秒,在此期间用户执行了另一个操作
因此我想关闭它,我们可以强行关闭它吗?
您链接的文档提到了
Methods for destruction are also provided:
然后他们说使用:
NzNotificationService.remove(id)
// Remove the notification with the specified id. When the id is empty, remove all notifications (the notification id is returned by the create method)
构造函数(私有通知:NzNotificationService){}
this.notification.remove()
或
this.notification.remove(id)