博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
angularjs如何打开modal
阅读量:4146 次
发布时间:2019-05-25

本文共 1553 字,大约阅读时间需要 5 分钟。

 
html代码:
 
modal代码: /myModalContent.html 
js代码: app.controller('xxxCtrl',[ '$scope', '$http', 'deviceService', '$modal', '$log', '$filter', function($scope,$http, deviceService,$modal,$log,$filter){ $scope.open = function() { var modalInstance = $modal.open({ templateUrl : 'assets/myModalContent.html', controller : ModalInstanceCtrl }); modalInstance.opened.then(function() {// 模态窗口打开之后执行的函数 console.log('modal is opened'); }); modalInstance.result.then(function(result) { console.log(result); }, function(reason) { console.log(reason);// 点击空白区域,总会输出backdrop // click,点击取消,则会暑促cancel $log.info('Modal dismissed at: ' + new Date()); }); }; var ModalInstanceCtrl = function($scope, $modalInstance) { /* $scope.items = items; $scope.selected = { item : $scope.items[0] };*/ $scope.ok = function() { $modalInstance.close($scope.selected); }; $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; };

转载地址:http://uviti.baihongyu.com/

你可能感兴趣的文章
第2章实验补充C语言中如何计算补码
查看>>
深入入门正则表达式(java) - 命名捕获
查看>>
使用bash解析xml
查看>>
android系统提供的常用命令行工具
查看>>
【Python基础1】变量和字符串定义
查看>>
【Python基础2】python字符串方法及格式设置
查看>>
【Python】random生成随机数
查看>>
【Python基础3】数字类型与常用运算
查看>>
Jenkins迁移jobs
查看>>
【Python基础4】for循环、while循环与if分支
查看>>
【Python基础5】列表和元组
查看>>
【Python基础6】格式化字符串
查看>>
【Python基础7】字典
查看>>
【Python基础8】函数参数
查看>>
【Python基础9】浅谈深浅拷贝及变量赋值
查看>>
Jenkins定制一个具有筛选功能的列表视图
查看>>
【Python基础10】探索模块
查看>>
【Python】将txt文件转换为html
查看>>
[Linux]Shell脚本实现按照模块信息拆分文件内容
查看>>
idea添加gradle模块报错The project is already registered
查看>>