$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. poj2793 素数和

    题目链接:http://poj.org/problem?id=2739 #include<iostream> using namespace std; int count=0; int p ...

  2. java 二叉树排序

    1 class BinaryTree{ 2 class Node{ 3 private Comparable data; 4 private Node left; 5 private Node rig ...

  3. Flash Builder4.7安装破解

    引用自CSDN博客,日后我会上传FlashBuilder到百度网盘谢谢 http://bbs.csdn.net/topics/391036327

  4. 工作流Activiti5.13学习笔记(一)

    了解工作流 1.工作流(Workflow),就是“业务过程的部分或整体在计算机应用环境下的自动化”,它主要解决的是“使在多个参与者之间按照某种预定义的规则传递文档.信息或任务的过程自动进行,从而实现某 ...

  5. 201621123050 《Java程序设计》第8周学习总结

    1. 本周学习总结 以你喜欢的方式(思维导图或其他)归纳总结集合相关内容. 2. 书面作业 1. ArrayList代码分析 1.1 解释ArrayList的contains源代码 答:ArrayLi ...

  6. 代码中输入数字自动筛选出最大值,使用array,for loop and if (21.9.2017)

    # include <stdio.h> # define N main(){ int a, b; ,,,,,,,,,,,,,,,,}; //array中输入需要排序的数字 ]; ; a & ...

  7. 前端之bootstrap模态框

    简介:模态框(Modal)是覆盖在父窗体上的子窗体.通常,目的是显示来自一个单独的源的内容,可以在不离开父窗体的情况下有一些互动.子窗体可提供信息.交互等. Modal简介 Modal实现弹出表单 M ...

  8. ASP.NET MVC中错误处理方式

    /// <summary> /// 标记了HandleError,并指明错误处理页为AboutError.aspx /// </summary> /// <returns ...

  9. Spring源码情操陶冶#task:scheduled-tasks解析器

    承接前文Spring源码情操陶冶#task:executor解析器,在前文基础上解析我们常用的spring中的定时任务的节点配置.备注:此文建立在spring的4.2.3.RELEASE版本 附例 S ...

  10. WPF 自定义ComboBox样式

    一.ComboBox基本样式 ComboBox有两种状态,可编辑和不可编辑状态.通过设置IsEditable属性可以切换控件状态. 先看基本样式效果: 基本样式代码如下: <!--ComboBo ...