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. 如何从 Xcode 控制台输出 JavaScript 的 log?

    调试 UIWebView 中的 JavaScript 一直以来都是很痛苦的一件事.通常我们会通过下面的方法调试 HTML 和 JavaScript. 1.第一种,使用桌面浏览器调试.大多数现代浏览器都 ...

  2. Caocao's Bridges

    hdu4738:http://acm.hdu.edu.cn/showproblem.php?pid=4738 题意:抽象出来就是求一条边权最小的割边. 题解:直接用tarjan即可破.但是如果只注重这 ...

  3. 【POJ11855】 Buzzwords (后缀数组)

    Description The word “the” is the most commonthree-letter word. It evenshows up inside other words, ...

  4. JSch - Java实现的SFTP(文件下载详解篇)(转)

    上一篇讲述了使用JSch实现文件上传的功能,这一篇主要讲述一下JSch实现文件下载的功能.并介绍一些SFTP的辅助方法,如cd,ls等.   同样,JSch的文件下载也支持三种传输模式:OVERWRI ...

  5. SSH自定义标签

     一.标签处理类:package cn.conris.sys.form; import java.io.IOException; import java.util.Enumeration; impor ...

  6. This configuration file was broken by system-config-keyboard

    posts • Page of problem with startx Postby evarie » // :: Normally i can get started with the x wind ...

  7. 【转】在VMware中安装OS X Yosemite

    原文网址:http://blog.gaohaobo.com/229.html OS X(前称:Mac OS X)操作系统是由苹果公司(Apple Inc.)为其Mac系列产品开发的.基于Unix的专属 ...

  8. (转载)JavaScript中定义变量

    (转载)http://blog.163.com/xuxiaoqianhz@126/blog/static/165190577201061594421870/ JavaScript中定义变量有两种方式: ...

  9. VS2010编译libjpeg

    环境:win7旗舰版 x64 VS2010 下载源代码下载地址:http://www.ijg.org/,选择windows format file 解压源代码,修改源代码中jconfig.vc为jco ...

  10. [转载]JQuery.closest(),parent(),parents()寻找父节点

    1.通过item-1查找 level-3(查找直接上级) $('li.item-1').closest('ul') $('li.item-1').parent() $('li.item-1').par ...