$modal

时间:2023-03-09 23:46:47
$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>

随机推荐

  1. Java注解Annotation学习

    学习注解Annotation的原理,这篇讲的不错:http://blog.csdn.net/lylwo317/article/details/52163304 先自定义一个运行时注解 @Target( ...

  2. 两个EXCEL文件对比去重

    两个EXCEL文件,A里面有10000条记录,B里面有4000条记录,A的记录包含了B里面所有的记录现在如何能把A里面没有包含B的6000条记录筛选出来? 那你要把两同时打开,比如book1 book ...

  3. 转:一个Sqrt函数引发的血案

    转自:http://www.cnblogs.com/pkuoliver/archive/2010/10/06/1844725.html 源码下载地址:http://diducoder.com/sotr ...

  4. ios中javascript直接调用oc代码而非通过改变url回调方式(转)

    之前一个ios项目中,需要通过UIWebview来打开一个静态页面,并在静态页面中 调用相关object-c代码. 一.以前使用js调用object-c的方法 关于如何使用javascript调用ob ...

  5. 简单ssh框架整合

    Struts2+Spring4 +Hibernate4 首先看看建立项目的框架 第一步  建立web项目 第二步  导入相对应需要的jar包(放在项目WEB-INFO/lib下) 需要导入Spring ...

  6. python网络编程socket之多进程

    #coding:utf-8 __author__ = 'similarface' import os,socket,threading,SocketServer SERVER_HOST='localh ...

  7. Unity5.3官方VR教程重磅登场-系列2

    作者:王寒链接:https://zhuanlan.zhihu.com/p/20485529来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处. 欢迎继续我们的学习. 北京时间 ...

  8. oneproxy---为实战而生之安装篇

       OneProxy是一款数据库中间件,与目前市面上的TDDL.MySQL-Proxy属于同类型产品.我们坚持研发OneProxy是基于如下几点考虑:       1. 我们不想被某一种开发语言绑定 ...

  9. quartz定时任务框架的使用

    quartz定时任务时间设置 这些星号由左到右按顺序代表 :     *    *     *     *    *     *   *                                 ...

  10. 修复iPhone的safari浏览器上submit按钮圆角bug

    今天在公司写了一个登录页面效果,让我碰到一个怪异的问题——"表单中的input type=submit和input type=reset按钮在iPhone的safari浏览器下圆角有一个bu ...