-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtml-directives.min.js
More file actions
2 lines (2 loc) · 3.33 KB
/
Copy pathhtml-directives.min.js
File metadata and controls
2 lines (2 loc) · 3.33 KB
1
2
"format global";"deps angular";!function(){"use strict";function a(a){return a.module("htmlDirectives",[]).provider("htmlDirectives",function(){var a=[],b=!1,c=null;this.setTemplateUrl=function(b){a=[b]},this.addTemplateUrl=function(b){a.push(b)},this._setCompiler=function(a){c=a},this.$get=function(){return{templateUrls:a,isCompiled:b,_compiler:c}}}).config(["$compileProvider","htmlDirectivesProvider",function(a,b){b._setCompiler(a)}]).run(["htmlDirectives","$http","$log",function(b,c,d){var e=function(b){var c="";return a.forEach(b.toLowerCase().split("-"),function(a,b){c+=0===b?a:a.charAt(0).toUpperCase()+a.slice(1)}),c},f=function(a,b,c){var f=e(a.name),g="Html-Directive ("+b+") attribute ("+f+") is reserved and contains a wrong value ("+a.value+"). Allowed values are: ";switch(f){case"replace":if("true"!==a.value&&"false"!==a.value){d.error(g+" true, false");break}c.replace=a.value;break;case"restrict":if(!a.value||!a.value.match(/^[AEC]{1,3}$/)){d.error(g+" A, E, C or any combination of these (AE, AEC, CE)");break}c.restrict=a.value.toUpperCase();break;case"transclude":if("true"!==a.value&&"false"!==a.value){d.error(g+" true, false");break}c.transclude=a.value;break;case"scope":d.error("Html-Directive ("+b+") attribute ("+f+") is reserved. See HTML-directives docs for defining scope variables.");break;case"template":case"templateUrl":case"require":d.error("Html-Directive ("+b+") attribute ("+f+") is reserved. However, provided by this attribute has not been yet implemented.");break;case"link":case"compile":case"controller":d.error("Html-Directive ("+b+") attribute ("+f+") should contain a javascript function. It is defined within separate <script> block inside directive. See docs.");break;default:if(a.value&&!a.value.match(/^[\@\=\&]$/)){d.error("Html-Directive ("+b+") attribute ("+f+') contains wrong value. You can have either "@", "=" or "&". Default is "=". See docs for meaning of these.');break}c.scope[f]=a.value?a.value:"="}},g=function(a,b){var c,d=["link","compile","controller"],e={};for(c in d)e[d[c]]=null;new Function("with(this) {"+a+"}").call(e);for(c in d){var f=d[c];"function"==typeof e[f]&&(b[f]=e[f])}"function"==typeof e.link&&(b.link=e.link)},h=function(c){var d=a.element(c),h=d[0].nodeName,i=e(h),j={restrict:"EA",template:d.html(),scope:{}};a.forEach(d[0].attributes,function(a){f(a,i,j)});var k=0;for(var l in j.scope)k+=1;0>=k&&delete j.scope;var m=d.find("script");m[0]&&m[0].innerHTML&&g(m[0].innerhTML,j),b._compiler.directive.apply(null,[i,function(){return j}])},i=b.templateUrls.length,j=0,k=function(){j++,j>=i&&(b.isCompiled=!0)};0===i&&(b.isCompiled=!0),a.forEach(b.templateUrls,function(b){c.get(b).then(function(b){var c=document.createElement("div");c.innerHTML=b.data;var d=a.element(c);a.forEach(d.children(),h),k()},function(a){d.error("Could not load HTML Directives from file "+b+" ("+a.status+", "+a.statusText+")"),k()})})}]).directive("htmlDirectives",["htmlDirectives","$compile","$animate",function(a,b,c){return{restrict:"A",terminal:!0,priority:1e3,compile:function(d){var e=d[0].innerHTML;return d.html(""),function(d,f){d.$watch(function(){return a.isCompiled},function(a){a&&c.enter(b(e)(d),f)},!0)}}}}])}"function"==typeof define&&define.amd?define(["angular"],a):"undefined"!=typeof module&&module&&module.exports?(a(angular),module.exports="htmlDirectives"):a(angular)}();
//# sourceMappingURL=html-directives.min.js.map