angular-class
Version:
An Angular service for creating classes with inheritance. Exposes the `Class` service.
1 lines • 557 B
JavaScript
angular.module("Class",[]).factory("Class",function(){function t(){}var n=!1,r=/xyz/.test(function(){})?/\b_super\b/:/.*/;return t.extend=function(t){function e(t,n){return function(){var r=this._super;this._super=s[t];var e=n.apply(this,arguments);return this._super=r,e}}function i(){!n&&this.init&&this.init.apply(this,arguments)}var s=this.prototype;n=!0;var u=new this;n=!1;for(var o in t)u[o]="function"==typeof t[o]&&"function"==typeof s[o]&&r.test(t[o])?e(o,t[o]):t[o];return i.prototype=u,i.prototype.constructor=i,i.extend=arguments.callee,i},t});