星期二, 3月 07, 2017

[AngularUI] 如何關閉uiboostrap的modal

常用到ui-bootstrap的modal,如果要將產生的dialog 實體關閉(關閉dialog),
可以使用下面的程式 。
use $rootScope
when initializing your modal use $rootScope.modalInstance
You can access it anywhere from the application then. Hope this helps

  1. Remove the $uibModalInstance references
  2. Instead of "var modalInstance = $uibModal.open({"
    Use "$rootScope.modalInstance = $uibModal.open({
  3. Instead of $uibModalInstance.close('a');"
    Use "$rootScope.modalInstance.close('a');"

沒有留言:

張貼留言

留個話吧:)

其他你感興趣的文章

Related Posts with Thumbnails