How to always run some code when a promise is fulfilled in Angular.js

前端 未结 4 660
囚心锁ツ
囚心锁ツ 2020-12-13 23:17

In my Angular.js application, I\'m running some asynchronous operation. Before it starts I cover the application with a modal div, then once the operation is complete, I nee

4条回答
  •  清歌不尽
    2020-12-13 23:33

    I would use ngView to render the content of the page and trigger the removal of you modal on the event $viewContentLoaded. See http://docs.angularjs.org/api/ng.directive:ngView for that event and http://docs.angularjs.org/api/ng.$rootScope.Scope for the $on event listener.

提交回复
热议问题