$modal
$scope.open = function (size,data) {
var modalInstance = $modal.open({
templateUrl: 'myModalContent.html',
controller: ModalInstanceCtrl,
size: size,
resolve: {
items: function () {
return data;
}
}
});
modalInstance.result.then(function (selectedItem) {
alert("11111")
}, function () {
alert("2222222222222")
});
};
var ModalInstanceCtrl = function ($scope, $modalInstance, items) {
if(items.type=="ADD_POINTS"){
$scope.title="ADD POINTS:"+items.points;
}
$scope.ok = function () {
$modalInstance.close(items);
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
};
<script type="text/ng-template" id="myModalContent.html">
<div class="modal-header">
<h3 class="modal-title">I'm a modal!</h3>
</div>
<div class="modal-body">
<b>{{ title }}</b>
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="ok()">OK</button>
<button class="btn btn-warning" ng-click="cancel()">Cancel</button>
</div>
</script>
随机推荐
- Android 项目中常用到的第三方组件
项目中常用到的第三方组件 1 社会化分享ShareSDK-Core-2.5.9.jarShareSDK-QQ-2.5.9.jarShareSDK-QZone-2.5.9.jarShareSDK-Sin ...
- C++——对象和类
最重要的OOP特性: *抽象: *封装和数据隐藏: *多态: *继承: *代码的可重用性: 一.抽象和类 1.类型 指定基本类型完成了三项工作:1).决定数据对象需要的内存数量:2).决定如何解释内存 ...
- Android开发面试经——3.常见Java基础笔试题
Android开发(29) 版权声明:本文为寻梦-finddreams原创文章,请关注:http://blog.csdn.net/finddreams 关注finddreams博客:http:/ ...
- 华为 1.static有什么用途?(请至少说明两种)
1.static有什么用途?(请至少说明两种) 1)在函数体,一个被声明为静态的变量在这一函数被调用过程中维持其值不变. 2) 在模块内(但在函数体外),一个被声明为静态的变量可以被模块内所用函数访问 ...
- D3.js 其他选择元素方法
在上一节中,已经讲解了 select 和 selectAll,以及选择集的概念.本节具体讲解这两个函数的用法. 假设在 body 中有三个段落元素: <p>Apple</p> ...
- shell脚本中获取本机ip地址的方法
ipaddr='172.0.0.1' ipaddr=$(ip addr | awk '/^[0-9]+: / {}; /inet.*global/ {print gensub(/(.*)\/(.*)/ ...
- KD-tree
就是K维空间上的二叉查找树. 每个node对应k维空间的超矩形区域 在方差最大的维度上,比较数据与kd-tree的根节点.中间节点,在该维度上的中值处划分,得到新的子空间,直到不能再分. 用于最近邻查 ...
- Mysql有两种存储引擎:InnoDB与Myisam
http://www.cnblogs.com/kevingrace/p/5685355.html
- git服务器搭建
http://blog.sina.com.cn/s/blog_904dee7f0101gait.html http://www.centoscn.com/image-text/install/2014 ...
- SVM中图像常用的HOG特征描述及实现
转摘网址:http://www.cnblogs.com/tiandsp/archive/2013/05/24/3097503.html Hog参考网址:http://www.cnblogs.com/t ...