12345678910 |
- /**
- * angular-strap
- * @version v2.3.9 - 2016-06-10
- * @link http://mgcrea.github.io/angular-strap
- * @author Olivier Louvignes <olivier@mg-crea.com> (https://github.com/mgcrea)
- * @license MIT License, http://www.opensource.org/licenses/MIT
- */
- 'use strict';angular.module('mgcrea.ngStrap.alert',['mgcrea.ngStrap.modal']).provider('$alert',function(){var e=this.defaults={animation:'am-fade',prefixClass:'alert',prefixEvent:'alert',placement:null,templateUrl:'alert/alert.tpl.html',container:!1,element:null,backdrop:!1,keyboard:!0,show:!0,duration:!1,type:!1,dismissable:!0};this.$get=['$modal','$timeout',function(t,n){function a(a){var r={},o=angular.extend({},e,a);r=t(o),r.$scope.dismissable=!!o.dismissable,o.type&&(r.$scope.type=o.type);var l=r.show;return o.duration&&(r.show=function(){l(),n(function(){r.hide()},1e3*o.duration)}),r}return a}]}).directive('bsAlert',['$window','$sce','$alert',function(e,t,n){return{restrict:'EAC',scope:!0,link:function(e,a,r,o){var l={scope:e,element:a,show:!1};angular.forEach(['template','templateUrl','controller','controllerAs','placement','keyboard','html','container','animation','duration','dismissable'],function(e){angular.isDefined(r[e])&&(l[e]=r[e])});var i=/^(false|0|)$/i;angular.forEach(['keyboard','html','container','dismissable'],function(e){angular.isDefined(r[e])&&i.test(r[e])&&(l[e]=!1)}),angular.forEach(['onBeforeShow','onShow','onBeforeHide','onHide'],function(t){var n='bs'+t.charAt(0).toUpperCase()+t.slice(1);angular.isDefined(r[n])&&(l[t]=e.$eval(r[n]))}),e.hasOwnProperty('title')||(e.title=''),angular.forEach(['title','content','type'],function(n){r[n]&&r.$observe(n,function(a,r){e[n]=t.trustAsHtml(a)})}),r.bsAlert&&e.$watch(r.bsAlert,function(t,n){angular.isObject(t)?angular.extend(e,t):e.content=t},!0);var s=n(l);a.on(r.trigger||'click',s.toggle),e.$on('$destroy',function(){s&&s.destroy(),l=null,s=null})}}}]);
- //# sourceMappingURL=alert.min.js.map
|