-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmagma.min.js
1 lines (1 loc) · 1.43 KB
/
magma.min.js
1
/*! Magma - v0.0.58 - 2015-02-02 */"use strict";angular.module("Magma",[]),angular.module("Magma").directive("mgView",["$animate","$rootScope","$compile",function(a,b,c){return{restrict:"A",replace:!1,priority:1e3,link:function(b,d){var e,f=b.$on("$routeChangeSuccess",function(){if(e){var g=d.clone().empty();g.removeAttr("mg-view"),g.attr("ng-view",""),d.after(g),a.leave(d),c(g)(b),f()}e=!0})}}}]),angular.module("Magma").directive("mgBind",["$rootScope","$compile",function(a,b){return{restrict:"A",priority:1e3,link:function(a,c,d){var e=a.$watch(function(){return a.$eval(d.mgBind)},function(f){f&&(c.attr("ng-bind",d.mgBind),c.removeAttr("mg-bind"),b(c)(a),e())})}}}]),angular.module("Magma").directive("mgInclude",["$compile","$animate",function(a,b){return{restrict:"A",link:function(c,d,e){var f=c.$watch(function(){return c.$eval(e.mgInclude)},function(g){if(g){var h=d.clone().empty();h.attr("ng-include",e.mgInclude),h.removeAttr("mg-include"),d.after(h),b.leave(d),a(h)(c),f()}})}}}]),angular.module("Magma").directive("mgSubmit",["$compile",function(a){return{restrict:"A",replace:!1,terminal:!0,priority:1e3,link:function(b,c,d){c.removeAttr("action"),c.removeAttr("method"),c.attr("ng-submit",d.mgSubmit),c.removeAttr("mg-submit"),a(c)(b)}}}]),angular.module("Magma").directive("mgScope",function(){return{restrict:"A",link:function(a,b,c){try{angular.extend(a,JSON.parse(c.mgScope))}catch(d){console.error("mgScope requires valid JSON to parse")}}}});