$uibModal&&$uibModalInstance

$uibModal和$uibModalInstance是一款angularJS的弹窗控件,github地址 http://angular-ui.github.io/bootstrap/#/modal

$uibModal:负责调出弹窗

$uibModalInstance:弹窗实例

例子如下:

弹窗 template:

 <script type="text/ng-template" id="detailWin">
<div class="marketing-strategyList-win">
<div class="modal-header">
<h4 class="modal-title">{{modalTitle}}</h4>
<div class="btn-close" ng-click="closeModal()">×</div>
</div>
<div class="modal-body">
<div class="cui-table">
<table class="table table-bordered mb20">
<thead class="table-header">
<tr class="table-row">
<th class="th-unit"><div class="th-countent">业务场景</div></th>
<th class="th-unit"><div class="th-countent">活动数</div></th> </tr>
</thead>
<tbody class="table-body">
<tr class="table-row" ng-repeat="$tr in tableData.strategyViewList">
<td class="td-unit">{{$tr.sceneName | nullFilter:'-'}}</td>
<td class="td-unit">{{$tr.activeCount}}</td>
</tr>
</tbody>
</table>
</div>
<div class="btn-warp">
<a class="btn cui-button cui-button-theme" ng-click="viewDetail()">查看详情</a>
</div>
</div>
</div>
</script>

调用弹窗controller

 app.controller('marketing.strategyCtrl', ['$scope', function($scope) {

     $uibModal.open({
animation: true, //弹窗toggle时是否有动画
template: $('#detailWin').html(), //弹窗模板
controller: 'marketing.strategyCtrl.win', // 弹窗controller
size: 'sm', //弹窗大小 sm、md、ld
resolve: { //数据交互
$postParams: function() {
return {
modalTitle: tag.name + act.name + "共计" + totalCount + '次',
data: d
};
}
}
}).result.then(function(postData) {
var pieData = pieCenter.initPieData(postData);
pieCenter.renderPieView(pieData);
});
}])

弹窗

 app.controller('marketing.strategyCtrl.win', ['$scope', '$postParams', '$uibModalInstance',
function($scope, $postParams, $uibModalInstance) {
$scope.modalTitle = $postParams.modalTitle;
$scope.tableData = $postParams.data;
window.tableData = $scope.tableData;
//关闭
$scope.closeModal = function() {
$uibModalInstance.dismiss();
};
//查看详情
$scope.viewDetail = function() {
//回调数据
$uibModalInstance.close({
data: $scope.tableData,
title: $scope.modalTitle
});
};
}
])

$stateProvider+$requireProvider配置路由,$state+$stateParams在路由中配置参数

var stateOptions = {
"url": item.url,
"templateUrl": path + item.templateUrl + "?v=" + version,
"customParams": item.customParams,
"resolve": {
deps: $requireProvider.require(tplResultArray),
js: $requireProvider.requireJS(jsResultArray),
css: $requireProvider.requireCSS(cssResultArray)
}
};
$stateProvider.state(item.name, stateOptions);
 {
"customParams": {
"parentState": "/marketing/userTpl",
"pageType": "edit"
},
"path": "/assets/modules/marketing/userTpl/",
"name": "/marketing/userTplEdit",
"url": "/marketing/userTplEdit?id",
"templateUrl": "templates/detail.tpl",
"js": [
"js/controllers/detailCtrl.js",
"js/services/service.js"
],
"css": [
"css/css.css"
],
"deps": []
}
 $scope.pageType = $state.current.customParams.pageType;
$scope.id = $stateParams.id;

angularJS的插件使用的更多相关文章

  1. AngularJS常用插件与指令收集

    angularjs 组件列表 bindonce UI-Router Angular Tree angular-ngSanitize模块-$sanitize服务详解 使用 AngularJS 开发一个大 ...

  2. angularJS 常用插件指令

    长时间没有登入博客园了,今天突然想了想,当初开这个的目的,其实就是为了记录你当下的一个状态和累计一些问题,所以记录这些还是很有意义,毕竟不是什么牛,靠脸又吃不饱的这个年代,需要留下一些东西给自己看也好 ...

  3. 转AngularJS路由插件

    AngularJS学习笔记--002--Angular JS路由插件ui.router源码解析 标签: angular源码angularjs 2016-05-04 13:14 916人阅读 评论(0) ...

  4. angularjs之插件ngRoute和ngAnimate

    使用ngRoute和ngAnimate配合使用,可以实现页面切换的效果. 如果有使用过swiper,就知道这个效果是怎么样的. 代码: <!DOCTYPE html> <html l ...

  5. angularjs上传图片插件使用

    一. angurlajs 相关 远程 jar 包 https://code.angularjs.org/angular-1.0.1.min.js 二. 正文 1. html 部分 <!-- 需要 ...

  6. Angularjs 表格插件的使用

    对于相关的table组件可以使用:UI Grid (ng-grid),ng-table,smart table,Angular-Datatables,tablelite,kendo-ui中的grid. ...

  7. angularJs FileUpload插件上传同一文件无效问题记录

    参考:https://blog.csdn.net/qq_34829447/article/details/83780392 问题:使用FileUpload插件进行文件上传时,发现无法上传与上个文件相同 ...

  8. Sublime Text 3安装AngularJS插件

    Sublime Text 3是目前笔者用过的最好用的代码编辑器之一,界面如下图所示: 我们可以用该编辑器开发AngularJS应用,首先需要安装AngularJS提示插件. 需要以下几步: 1.安装P ...

  9. angularJS实现可编辑的下拉框

    将angularJS与插件select2结合使用即可 <!DOCTYPE html><html lang="en"><head>    < ...

随机推荐

  1. 【Python】 系统配置/进程等信息查看 psutil

    psutil 原以为psutil只是跟进程有关的一个模块,没想到它其实提供了从CPU到内存各种各样的信息,十分IMBA.记录一下 我用了pip install psutil安装的这个模块,不过路中遇到 ...

  2. zabbix自定义key监控mysql主从同步超简单!

    原理:利用在slave上运行show slave status获取Slave_IO_Running和Slave_SQL_Running的值 1.在zabbix客户端配置文件中加入: 首先要对mysql ...

  3. oracle 常用sql字符函数介绍

    常用字符函数介绍 1.ascii 返回与指定的字符对应的十进制数: SQL>select ascii('A') A,ascii('a') a,ascii('0') zero,ascii(' ') ...

  4. python爬虫---抓取优酷的电影

    最近在学习爬虫,用的BeautifulSoup4这个库,设想是把优酷上面的电影的名字及链接爬到,然后存到一个文本文档中.比较简单的需求,第一次写爬虫.贴上代码供参考: # coding:utf-8 i ...

  5. CSS 语法

    CSS 语法 CSS 规则由两个主要的部分构成:选择器,以及一条或多条声明: 选择器通常是您需要改变样式的 HTML 元素. 每条声明由一个属性和一个值组成. 属性(property)是您希望设置的样 ...

  6. oracle exp(expdp)数据迁移(生产环境,进行数据对比校验)

    前言:客户需要迁移XX 库 ZJJJ用户(迁移到其他数据库),由于业务复杂,客户都弄不清楚里面有哪些业务系统,为保持数据一致性,需要停止业务软件,中间件,杀掉oracle进程. 一.迁移数据倒出部分= ...

  7. 读论文系列:Object Detection CVPR2016 YOLO

    CVPR2016: You Only Look Once:Unified, Real-Time Object Detection 转载请注明作者:梦里茶 YOLO,You Only Look Once ...

  8. C语言使用指针变量指向字符串,对字符串进行处理后再将指针移向开头为什么不能输出?(使用Dev-c++进行编译)

    # include <stdio.h> # include <stdlib.h> int main() { char *point_1="aaaaaabbbbbbzz ...

  9. [福大软工] W班 团队第一次作业—团队展示成绩公布

    作业地址 https://edu.cnblogs.com/campus/fzu/FZUSoftwareEngineering1715W/homework/906 作业要求 根据已经组队的队伍组成, 每 ...

  10. http post/get 2种使用方式

     public class HttpUtil { //HttpPost public static String executePost(String url, List<NameValue ...