$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. Ubuntu上安装和使用RabbitMQ

    1. 安装RabbitMQ服务软件包 输入以下命令进行安装 #apt install rabbitmq-server 2.安装完成后在rabbitMQ中添加用户 命令:#rabbitmqctl add ...

  2. spring-boot-devtools

    Create a new Maven Project  and  we have two class under the package com.example.demo like below scr ...

  3. postman简单教程,使用tests模块来验证接口时是否通过

    接口测试醉重要的就是返回数据的检查,一个简单的接口,我们可以肉眼检查返回数据,但接口一旦多起来且复杂,每次的检查都会很费劲,此时我们就需要postman 的tests模块来代替 概念: Postman ...

  4. Matlab绘图基础——绘制向量图,二维三维(绘制参数曲线图)

    ------------------------------------------- %绘制向量场图 %例一 clear all;clc; [X,Y] = meshgrid(-2:.2:2,-3:. ...

  5. 在Python中使用Redis

    在Python中要使用Redis数据库,首先要安装redis 之前的博客中有写到在命令行模式下操作Redis数据库. 要在项目中使用的话可以这么做: 通过初始化 redis.Redis,得到返回的对象 ...

  6. C语言嵌套循环作业

    一.PTA实验作业 题目1:7-4 换硬币 1. 本题PTA提交列表 2. 设计思路 1.定义fen5:5分硬币数量, fen2:2分硬币数量, fen1:1分硬币数量, total:硬币总数量,co ...

  7. C语言博客作业--数据类型

    一.PTA实验作业 题目1:7-8 判断合法标识符 1. 本题PTA提交列表 2. 设计思路 1.定义整数型变量repeat和i来存放判断字符串是否为合法标识符的次数,定义字符型ch来存放读取的字符 ...

  8. Alpha冲刺No.6

    站立式会议 继续页面设计 在安卓内构件数据库相应类 解决摄像头.照片的使用的异常问题 二.实际项目进展 页面设计完成百分80 类架构完成 在虚拟机中,能够完成摄像头的调用和程序的使用 三.燃尽图 四. ...

  9. Beta敏捷冲刺每日报告——Day1

    1.情况简述 Beta阶段Scrum Meeting 敏捷开发起止时间 2017.11.2 00:00 -- 2017.11.3 00:00 讨论时间地点 2017.11.2 晚9:30,电话会议会议 ...

  10. 关于java中的数组

    前言:最近刚刚看完了<Java编程思想>中关于数组的一章,所有关于Java数组的知识,应该算是了解的差不多了.在此再梳理一遍,以便以后遇到模糊的知识,方便查阅. Java中持有对象的方式, ...