angularjs modal 嵌套modal的问题
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的问题的更多相关文章
- iview框架modal中嵌套modal
modal的使用是平级的,后面的会覆盖前面,如下<modal>111</modal><modal>222</modal>内容为222的弹框会在内容为11 ...
- AngularJS 的嵌套路由 UI-Router
AngularJS 的嵌套路由 UI-Router 本篇文章翻译自:https://scotch.io/tutorials/angular-routing-using-ui-router 演示网站请查 ...
- AngularJS ui-router (嵌套路由)
http://www.oschina.net/translate/angularjs-ui-router-nested-routes AngularJS ui-router (嵌套路由) 英文原文:A ...
- [AngularJS] “多重路由”嵌套模块——AngularJS“路由”嵌套学习资料教程
这是小编的一些学习资料,理论上只是为了自己以后学习需要的,但是还是需要认真对待的 以下内容仅供参考,请慎重使用学习 1.AngularJS路由嵌套 Angularjs本身自带路由模块,可以满足通过不同 ...
- [转]AngularJS ui-router (嵌套路由)
本文转自:http://www.oschina.net/translate/angularjs-ui-router-nested-routes http://www.codeproject.com/A ...
- ng2-bootstrap的modal嵌套时无法滚动的情况
在ng2-bootstrap的弹窗modal中再弹出另外一个弹窗,关闭子弹窗后,父弹窗会出现无法上下滚动的情况. 通过观察样式可知,关闭子弹窗前,父弹窗的body上是有modal-open样式的,关闭 ...
- Bootstrap多层模态框modal嵌套问题
一.问题 在项目里忽然新加了一个需求,在原本弹出的模态框里,点击模态框里面的按钮再弹出一个模态框,出来另个模态框来展示详细信息.此时就存在两个模态框在这个需求没加之前有一个弹出的模态框也是需要继续点击 ...
- AngularJS指令嵌套时link函数执行顺序的问题
今天研究指令嵌套时,发现子指令的link函数先于父指令的link函数执行. 这样和预想的顺序不一样. 也就是说,如果子指令的某个scope变量依赖于父指令传来的参数时,可能一直是undefinded比 ...
- 关于bootstrap的modal弹出层嵌套子Modal所引发的血案(转)
原文地址 http://blog.csdn.net/liuxiaogangqq/article/details/51821359 bootstrap的弹出层嵌套有一个问题 ,当子modal关闭时父的m ...
随机推荐
- C/C++ 中的0长数组(柔性数组)
转自C/C++ 中的0长数组(柔性数组) 在标准C和C++中0长数组如charArray[0]是不允许使用的,因为这从语义逻辑上看,是完全没有意义的.但是,GUN中却允许使用,而且,很多时候,应用在了 ...
- 转-[Python 学习]2.5版yield之学习心得
在 shhgs 发布了关于< Py 2.5 what’s new 之 yield>之后,原来我不是特别关注 yield 的用法,因为对于2.3中加入的yield相对来说功能简单,它是作为一 ...
- gcc c语言中scanf输入格式不正确,清空缓冲区问题
我的博客:www.while0.com 折磨了一下午,只因为fflush(stdin)再gcc里和vc里表现不一致.gcc里不能够清空缓冲区.直接上例子: #include <stdio.h&g ...
- Volatile总结
在java线程并发处理中,有一个关键字volatile的使用目前存在很大的混淆,以为使用这个关键字,在进行多线程并发处理的时候就可以万事大吉. Java语言是支持多线程的,为了解决线程并发的问题,在语 ...
- Different Ways to Add Parentheses——Leetcode
Given a string of numbers and operators, return all possible results from computing all the differen ...
- Android客户端调用Asp.net的WebService
Android客户端调用Asp.net的WebService 我来说两句 |2011-11-23 13:39:15 在Android端为了与服务器端进行通信有几种方法:1.Socket通信2.WCF通 ...
- Android学习笔记(六)Fragment的生命周期
在上一篇博文中对Fragment做了简单的介绍,现在再来探讨一下Fragment的生命周期. 一.Fragment的几种状态: 与Activity类似,Fragment也有一下几种状态: · 活动状态 ...
- arm 及ndk编译
首页 » Android android的armeabi跟armeabi-v7a 网友分享于:2014-03-16 浏览:867次 android的armeabi和armeabi-v7 ...
- Java Struts2 的请求处理流程详解
一.Struts2的处理流程: 客户端产生一个HttpServletRequest的请求,该请求被提交到一系列的标准过滤器(Filter)组建链中(如ActionContextCleanUp:它主要是 ...
- Windows 安装Django并创建第一个应用
学习python 也有一段时间了,语法也学得差不多了,突然就想学一学python的web开源开源框架Django,我用的是Django-1.6.2.tar.gz,可以在官网https://www.dj ...