如何在Angular 2到RX存储中几秒钟后隐藏弹出消息?
以下是我正在处理的代码:
case ECMTOOL_RUN_SAVE_SUCCESS:
return Object.assign({},state,{
isSaveComplete: true,
blockForm:false,
saveResponse: action.payload,
msgs: [{severity:'success', summary:'Message', detail:'Model saved'}]
});
消息“模型保存”应在几秒后消失......
答案 0 :(得分:1)
您可以使用Javascripts setTimeout()
。
setTimeout(() => {
hidePopup = true; //change the *ngIf variable here
}, 1000); //1000 equals the time in miliseconds