anguarjs中当遇到modal嵌套modal的时候,比如一个modal弹出啦一个modal1,关闭modal1后,modal本身的关闭功能失效,那么需要$modal来生命弹出的modal1并且关闭

js:

.controller('infoWindowCtrl', function($scope,NiDialog,$modal) {
$scope.showInfo = function(obj,title) {
var modalInstance;
modalInstance=$modal.open({
windowClass: '',
size:'tableContent',
backdrop: 'static',
keyboard: false,
templateUrl: '/static/tpl/front/order/contactInfo.tpl',
controller: 'contactCtrl',
resolve:{
id:function(){
return obj.$parent.model.id;
},
title:function(){
return title;
}
}
});
} })
.controller('contactCtrl', function($scope,NiDialog,NiHttp,$modalInstance,id,title) {
var vm = $scope.vm = {};
var fn = $scope.fn = {};
fn.close=function(){
$modalInstance.close();
}
}])

To close a $modal that you have opened you can follow these steps.

1) Inject $modalInstance into the controller that you specified when you created the modal. In your case you called it contactCtrl.

2) Have a function in your ModalInstanceCtrl that calls .close() on $modalInstance.

具体参考:http://plnkr.co/edit/SpEx6Y?p=preview

angularjs modal 嵌套modal的问题的更多相关文章

  1. iview框架modal中嵌套modal

    modal的使用是平级的,后面的会覆盖前面,如下<modal>111</modal><modal>222</modal>内容为222的弹框会在内容为11 ...

  2. AngularJS 的嵌套路由 UI-Router

    AngularJS 的嵌套路由 UI-Router 本篇文章翻译自:https://scotch.io/tutorials/angular-routing-using-ui-router 演示网站请查 ...

  3. AngularJS ui-router (嵌套路由)

    http://www.oschina.net/translate/angularjs-ui-router-nested-routes AngularJS ui-router (嵌套路由) 英文原文:A ...

  4. [AngularJS] “多重路由”嵌套模块——AngularJS“路由”嵌套学习资料教程

    这是小编的一些学习资料,理论上只是为了自己以后学习需要的,但是还是需要认真对待的 以下内容仅供参考,请慎重使用学习 1.AngularJS路由嵌套 Angularjs本身自带路由模块,可以满足通过不同 ...

  5. [转]AngularJS ui-router (嵌套路由)

    本文转自:http://www.oschina.net/translate/angularjs-ui-router-nested-routes http://www.codeproject.com/A ...

  6. ng2-bootstrap的modal嵌套时无法滚动的情况

    在ng2-bootstrap的弹窗modal中再弹出另外一个弹窗,关闭子弹窗后,父弹窗会出现无法上下滚动的情况. 通过观察样式可知,关闭子弹窗前,父弹窗的body上是有modal-open样式的,关闭 ...

  7. Bootstrap多层模态框modal嵌套问题

    一.问题 在项目里忽然新加了一个需求,在原本弹出的模态框里,点击模态框里面的按钮再弹出一个模态框,出来另个模态框来展示详细信息.此时就存在两个模态框在这个需求没加之前有一个弹出的模态框也是需要继续点击 ...

  8. AngularJS指令嵌套时link函数执行顺序的问题

    今天研究指令嵌套时,发现子指令的link函数先于父指令的link函数执行. 这样和预想的顺序不一样. 也就是说,如果子指令的某个scope变量依赖于父指令传来的参数时,可能一直是undefinded比 ...

  9. 关于bootstrap的modal弹出层嵌套子Modal所引发的血案(转)

    原文地址 http://blog.csdn.net/liuxiaogangqq/article/details/51821359 bootstrap的弹出层嵌套有一个问题 ,当子modal关闭时父的m ...

随机推荐

  1. Git遇到的一点错误

    [背景] 折腾: [记录]将googlecode上面的crifanLib迁移到Github上 期间出错: ​ ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 ...

  2. Linux Shell 学习笔记

    2.return与exit区别 return 表示从被调函数返回到主调函数继续执行,返回时可附带一个返回值,由return后面的参数指定,当然如果是在主函数main, 自然也就结束当前进程了,如果不是 ...

  3. 【HDOJ】3183 A Magic Lamp

    RMQ. /* 3183 */ #include <cstdio> #include <cstring> #include <cstdlib> #define MA ...

  4. 使用bacula实现Linux的远程备份和还原

    Bacula,被誉为开源软件中最好的备份还原软件,它提供了企业级的客户机/服务器的备份解决方案,能够通过网络来管理文件的备份,恢复和核实工作.Bacula,既有windows版本的,也有Linux,U ...

  5. vector,list,deque容器的迭代器简单介绍

    我们知道标准库中的容器有vector,list和deque.另外还有slist,只不过它不是标准容器.而谈到容器,我们不得不知道进行容器一切操作的利器---迭代器.而在了解迭代器之前,我们得先知道每个 ...

  6. 通过ComponentName获取相应的Widget

    最近在锁屏上研究,如果预置widget,研究了好久,终于找到方法了,先上代码: private int getAppWidgetFromComName(ComponentName providerCo ...

  7. Google Map API 学习六-设置infoWindow的长宽

  8. 博弈论(二分图匹配):NOI 2011 兔兔与蛋蛋游戏

    Description Input 输入的第一行包含两个正整数 n.m. 接下来 n行描述初始棋盘.其中第i 行包含 m个字符,每个字符都是大写英文字母"X".大写英文字母&quo ...

  9. Unity3D屠龙战机项目总结

    之前跟着老师后面边学边做了一个屠龙战机项目,在这个项目中,主要用到的技术,在这里总结一下(本次项目的脚本语言用的是JS): 1.  如果想在场景中导入一个声音文件,则需要在脚本中添加一个变量,如在脚本 ...

  10. UVA 10561 Treblecross(博弈论)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=32209 [思路] 博弈论. 根据X分布划分禁区,每个可以放置的块为 ...