forked from btford/angular-modal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodal.min.js
8 lines (8 loc) · 1.16 KB
/
modal.min.js
1
2
3
4
5
6
7
8
/*
* @license
* angular-modal v0.4.0
* (c) 2013 Brian Ford http://briantford.com
* License: MIT
*/
"use strict";angular.module("btford.modal",[]).factory("btfModal",["$animate","$compile","$rootScope","$controller","$q","$http","$templateCache",function(e,t,r,n,o,a,l){return function(c){function u(e){return p.then(function(t){return $||i(t,e),$})}function i(o,a){if($=angular.element(o),0===$.length)throw new Error("The template contains no elements; you need to wrap text nodes");if(e.enter($,h),d=r.$new(),a)for(var l in a)d[l]=a[l];var c=n(s,{$scope:d});v&&(d[v]=c),t($)(d)}function m(){var t=o.defer();return $?e.leave($,function(){d.$destroy(),$=null,t.resolve()}):t.resolve(),t.promise}function f(){return!!$}if(!(!c.template^!c.templateUrl))throw new Error("Expected modal to have exacly one of either `template` or `templateUrl`");var p,d,s=(c.template,c.controller||angular.noop),v=c.controllerAs,h=angular.element(c.container||document.body),$=null;if(c.template){var g=o.defer();g.resolve(c.template),p=g.promise}else p=a.get(c.templateUrl,{cache:l}).then(function(e){return e.data});return{activate:u,deactivate:m,active:f}}}]);
//# sourceMappingURL=modal.min.js.map