指令
directive('bsPopup', function ($parse) {
return {
require: 'ngModel',
restrict: 'A',
link: function (scope, elem, attrs, ctrl) {
scope.$watch(function () {
return $parse(ctrl.$modelValue)(scope);
}, function (newValue) {
if (newValue ==) {
$(elem).modal('hide');
return;
}
if (newValue == ) {
$(elem).modal('show');
return;
}
});
}
}
});
 <button class="btn btn-xs btn-warning" data-target="#myModal" data-toggle="modal" ng-click="sss()">弹框</button>
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" class="modal fade" bs-popup="" ng-model="test"
id="myModal" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header alert-info">
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
<h4 id="myModalLabel" class="modal-title">弹框</h4>
</div>
<div class="modal-body">
<button class="btn btn-info" ng-click="hhh()">测试</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

Bootstrap+Angularjs自制弹框的更多相关文章

  1. 自己写的基于bootstrap风格的弹框插件

    自己写的一款基于bootstrap风格的弹框插件,暂时只有确认框.提示框.后续功能扩展.bug修改再更新. ;(function($){ //默认参数 var PARAMS; var DEFAULTP ...

  2. angularjs指令弹框点击空白处隐藏及常规方法

    效果图展示: 第一种方法:angularjs自定义指令: 指令: app.directive('onBlankHide', function () { return { restrict: 'A', ...

  3. 参考bootstrap中的popover.js的css画消息弹框

    前段时间小颖的大学同学给小颖发了一张截图,图片类似下面这张图: 小颖当时大概的给她说了下,其实小颖也不知道上面那个三角形怎么画嘻嘻,给她说了DOM结构,具体的css让她自己百度,今天小颖自己参考boo ...

  4. bootstrap弹框

    http://v3.bootcss.com/javascript/#modals 参考bootstrap官网 模态框做php后端 前端一直不行,但是很多时候 用到ajax都要用到弹框,一直在代码里面找 ...

  5. Bootstrap学习笔记(9)--模态框(登录/注册弹框)

    说明: 1. 上来一个ul先把登录和注册两个链接扔进去,ul的类nav,navbar-nav是导航条,navbar-right让他固定在右侧.每个li的里面,data-toggle="mod ...

  6. angularJs $mdDialog和$uibModal弹框关闭传值

    $mdDialog以一个点击button按钮出现弹框为例: $scope.btn=function($event,row){ var dScope = $scope.$new(true); dScop ...

  7. bootstrap + angularjs + seajs构建Web Form前端(1)

    bootstrap + angularjs + seajs构建Web Form前端(一) 简介 Bootstrap是Twitter推出的一个用于前端开发的开源工具包,它由Twitter的设计师Mark ...

  8. js弹框3秒后自动消失

    开发中有时候会需要最出弹框后,过几秒自动消失的效果,下面给大家分享一下我自己做的一个小案例. 案例中的弹框使用的是bootstrap里面的模态框,实现自动消失则用的是js中的setInterval方法 ...

  9. Bootstrap Modals(模态框)

    http://www.runoob.com/bootstrap/bootstrap-v2-modal-plugin.html 描述 Bootstrap Modals(模态框)是使用定制的 Jquery ...

随机推荐

  1. Mac MySQL 数据库管理(关系型数据库管理系统)

    1.管理准备工作 1)管理数据库准备工作 下载相关软件 mysql-workbench-community-6.3.10-macos-x86_64.dmg Oracle 官网 MySQL 官网 MyS ...

  2. Git工程迁移方法总结(命令行) .(转载)

    原文地址:http://blog.csdn.net/hongshan50/article/details/236630433 Git工程迁移方法总结 Git工程迁移方法总结 Git最近准备迁移一下位置 ...

  3. JS遍历Table的所有单元格内容

    用JS去遍历Table的所有单元格中的内容,可以用如下JS代码实现: 这个方法的参数是唯一标识Table的id,用document对象的获取. function GetInfoFromTable(ta ...

  4. centos7 中搭建gitlab

    1.在virtual box中新建一个虚拟机 2.gitlab ce(community版本)地址:https://about.gitlab.com/installation/#centos-7?ve ...

  5. Android之四大组件、六大布局、五大存储 总结

    Android之四大组件.六大布局.五大存储 一.四大组件:Android四大组件分别为activity.service.content provider.broadcast receiver.   ...

  6. mongoimport mongo导入Json的用法

    //导入json mongoimport --db ML_OER --collection lecture --file /home/tmp/course_temp.json //导入Json数组 m ...

  7. redis 3.2.3的源码安装

    Install necessary packages On CentOS : yum install wget make gcc tcl On CentOS yum install wget make ...

  8. spark-submit的参数名称解析

    执行时需要传入的参数说明 Usage: spark-submit [options] <app jar | Python file> [app options] 参数名称 含义 --mas ...

  9. 互联网创业原则与创业模式attilax大总结

    互联网创业原则与创业模式attilax大总结 1. 适合普通人的的创业模式1 1.1. 网络创业  兼职创业 概念创业 团队 创业  内部创业..1 2. 创业模式大总结1 2.1. 工作室创业1 2 ...

  10. [100]tar命令打包(排除目录或文件)

    在linux中可以用tar打包目录以方便传输or备份,我们先来看一个例子 Linux下tar命令exclude选项排除指定文件或目录 test 文件夹有如下文件 [root@lee ~]# ll te ...