forked from btford/angular-modal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodal.min.js
More file actions
7 lines (7 loc) · 961 Bytes
/
modal.min.js
File metadata and controls
7 lines (7 loc) · 961 Bytes
1
2
3
4
5
6
7
/*
* @license
* angular-modal v0.2.1
* (c) 2013 Brian Ford http://briantford.com
* License: MIT
*/
"use strict";angular.module("btford.modal",[]).factory("btfModal",["$compile","$rootScope","$controller","$q","$http","$templateCache",function(e,t,r,n,o,a){return function(l){function c(e){p.then(function(t){h||u(t,e)})}function u(n,o){if(h=angular.element(n),$.prepend(h),f=t.$new(),o)for(var a in o)f[a]=o[a];var l=r(d,{$scope:f});v&&(f[v]=l),e(h)(f)}function i(){h&&(f.$destroy(),h.remove(),h=null)}function m(){return!!h}if(+!!l.template+ +!!l.templateUrl!==1)throw new Error("Expected modal to have exacly one of either `template` or `templateUrl`");var p,f,d=(l.template,l.controller||angular.noop),v=l.controllerAs,$=angular.element(l.container||document.body),h=null;if(l.template){var s=n.defer();s.resolve(l.template),p=s.promise}else p=o.get(l.templateUrl,{cache:a}).then(function(e){return e.data});return{activate:c,deactivate:i,active:m}}}]);