/** * angular-strap * @version v2.0.3 - 2014-05-30 * @link http://mgcrea.github.io/angular-strap * @author Olivier Louvignes (olivier@mg-crea.com) * @license MIT License, http://www.opensource.org/licenses/MIT */ "use strict";angular.module("mgcrea.ngStrap.alert",["mgcrea.ngStrap.modal"]).provider("$alert",function(){var t=this.defaults={animation:"am-fade",prefixClass:"alert",placement:null,template:"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(e,n){function a(a){var r={},i=angular.extend({},t,a);r=e(i),r.$scope.dismissable=!!i.dismissable,i.type&&(r.$scope.type=i.type);var o=r.show;return i.duration&&(r.show=function(){o(),n(function(){r.hide()},1e3*i.duration)}),r}return a}]}).directive("bsAlert",["$window","$location","$sce","$alert",function(t,e,n,a){t.requestAnimationFrame||t.setTimeout;return{restrict:"EAC",scope:!0,link:function(t,e,r){var i={scope:t,element:e,show:!1};angular.forEach(["template","placement","keyboard","html","container","animation","duration","dismissable"],function(t){angular.isDefined(r[t])&&(i[t]=r[t])}),angular.forEach(["title","content","type"],function(e){r[e]&&r.$observe(e,function(a){t[e]=n.trustAsHtml(a)})}),r.bsAlert&&t.$watch(r.bsAlert,function(e){angular.isObject(e)?angular.extend(t,e):t.content=e},!0);var o=a(i);e.on(r.trigger||"click",o.toggle),t.$on("$destroy",function(){o.destroy(),i=null,o=null})}}}]);