Angular - 如何在几秒钟后隐藏弹出窗口?

时间:2017-08-10 15:47:59

标签: angular ngrx-store ngrx-effects

如何在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'}]
  });

消息“模型保存”应在几秒后消失......

1 个答案:

答案 0 :(得分:1)

您可以使用Javascripts setTimeout()

setTimeout(() => {
    hidePopup = true; //change the *ngIf variable here
}, 1000); //1000 equals the time in miliseconds