This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
SXS20240115/SRC/iMES_PDA/JSplugins/angularAMD/angularAMD.min.js
2024-01-24 16:47:50 +08:00

1 line
3.9 KiB
JavaScript

define(function(){"use strict";var e=false,r,n,t,o,i,l={},u,a,c={},f=[],p={},d={},s=[];function v(){if(!e){throw new Error("angularAMD not initialized. Need to call angularAMD.bootstrap(app) first.")}}function y(){if(a){throw new Error("setAlternateAngular can only be called once.")}else{a={}}v();u.extend(a,u);a.module=function(e,r){if(typeof r==="undefined"){if(d.hasOwnProperty(e)){return p[e]}else{return u.module(e)}}else{var n=u.module.apply(null,arguments),t={name:e,module:n};s.push(t);u.extend(n,c);d[e]=true;p[e]=n;return n}};window.angular=a}function g(){}g.prototype.route=function(e){var r;if(e.hasOwnProperty("controllerUrl")){r=e.controllerUrl;delete e.controllerUrl;if(typeof e.controller==="undefined"){e.controller=["$scope","__AAMDCtrl","$injector",function(e,r,n){if(typeof r!=="undefined"){n.invoke(r,this,{$scope:e})}}]}}else if(typeof e.controller==="string"){r=e.controller}if(r){var n=e.resolve||{};n["__AAMDCtrl"]=["$q","$rootScope",function(e,n){var t=e.defer();require([r],function(e){t.resolve(e);n.$apply()});return t.promise}];e.resolve=n}return e};g.prototype.appname=function(){v();return r};g.prototype.processQueue=function(){v();if(typeof a==="undefined"){throw new Error("Alternate angular not set. Make sure that `enable_ngload` option has been set when calling angularAMD.bootstrap")}function e(e){o.invoke(e)}while(s.length){var r=s.shift(),n=r.module._invokeQueue,t;for(t=0;t<n.length;t+=1){var u=n[t],c=u[0],f=u[1],d=u[2];if(l.hasOwnProperty(c)){var y;if(c==="$injector"&&f==="invoke"){y=i}else{y=l[c]}y[f].apply(null,d)}else{if(window.console){window.console.error('"'+c+'" not found!!!')}}}if(r.module._configBlocks){var g=r.module._configBlocks;for(t=0;t<g.length;t+=1){var h=g[t],m=h[1],w=h[2];i[m].apply(null,w)}}if(r.module._runBlocks){angular.forEach(r.module._runBlocks,e)}p={}}};g.prototype.getCachedProvider=function(e){v();var r;switch(e){case"__orig_angular":r=u;break;case"__alt_angular":r=a;break;case"__orig_app":r=n;break;case"__alt_app":r=t;break;default:r=l[e]}return r};g.prototype.inject=function(){v();return o.invoke.apply(null,arguments)};g.prototype.config=function(){v();return i.invoke.apply(null,arguments)};g.prototype.reset=function(){if(typeof u==="undefined"){return}window.angular=u;n=undefined;t=undefined;a=undefined;u=undefined;c={};f=[];s=[];r=undefined;o=undefined;i=undefined;l={};e=false};g.prototype.bootstrap=function(a,p,d){if(e){throw Error("bootstrap can only be called once.")}if(typeof p==="undefined"){p=true}u=angular;n=a;t={};u.extend(t,n);d=d||document.documentElement;a.config(["$controllerProvider","$compileProvider","$filterProvider","$animateProvider","$provide","$injector",function(e,r,n,o,u,a){i=a;l={$controllerProvider:e,$compileProvider:r,$filterProvider:n,$animateProvider:o,$provide:u};angular.extend(c,{provider:function(e,r){u.provider(e,r);return this},controller:function(r,n){e.register(r,n);return this},directive:function(e,n){r.directive(e,n);return this},filter:function(e,r){n.register(e,r);return this},factory:function(e,r){u.factory(e,r);return this},service:function(e,r){u.service(e,r);return this},constant:function(e,r){u.constant(e,r);return this},value:function(e,r){u.value(e,r);return this},animation:angular.bind(o,o.register)});angular.extend(t,c)}]);a.run(["$injector",function(e){o=e;l.$injector=o}]);r=a.name;if(f.length>0){for(var s=0;s<f.length;s+=1){var v=f[s];n[v.recipe](v.name,v.constructor)}f=[]}n.register=c;u.element(document).ready(function(){u.bootstrap(d,[r]);e=true;if(p){y()}});return t};function h(r){return function(n,t){if(e){c[r](n,t)}else{f.push({recipe:r,name:n,constructor:t})}return this}}g.prototype.provider=h("provider");g.prototype.controller=h("controller");g.prototype.directive=h("directive");g.prototype.filter=h("filter");g.prototype.factory=h("factory");g.prototype.service=h("service");g.prototype.constant=h("constant");g.prototype.value=h("value");g.prototype.animation=h("animation");return new g});