Forked from wuxiaoying/gist:f118fd6bbfbb89e497d9
Last active
August 29, 2015 14:02
-
-
Save davej/49b25fa90f75c7615919 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extendsScope_module = angular.module 'classy-extends', ['classy-core'] | |
### | |
Note that this does NOT get the mixin class dependencies as of now. | |
### | |
extendsScope_module.classy.plugin.controller | |
name: 'extends' | |
localInject: ['$controller'] | |
baseClasses: [] | |
options: | |
enabled: true | |
ignore: ['constructor', 'init', 'initScope'] | |
isActive: (klass, deps) -> | |
if @options.enabled and klass.mixins | |
if !deps.$scope | |
throw new Error "You need to inject `$scope` to use the watch object" | |
return false | |
return true | |
preInitBefore: (classConstructor, classObj, module) -> | |
if classObj.isBaseClass | |
@baseClasses.push classObj.name, classConstructor | |
preInit: (classConstructor, classObj, module) -> | |
for baseClass in @baseClasses | |
for name, method of baseClass | |
classConstructor.prototype[name] = method | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment