angular ui modal after close event

前端 未结 2 758
余生分开走
余生分开走 2021-02-01 13:53

Is there a way I can call a function after a modal window got called (no matter if it happened with a button or by clicking on the backdrop)

var dialog, options;         


        
2条回答
  •  佛祖请我去吃肉
    2021-02-01 14:39

    Angular 1.2 supports promises with a finally(callback):

    dialog.result.finally(function() {
        alert('clean up resources');
    });
    

    Check out the working plunker here.

提交回复
热议问题