Created
November 13, 2013 17:18
-
-
Save diverted247/7452825 to your computer and use it in GitHub Desktop.
Tang early angular.Module proxy
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
declare var angular:any; | |
module tang{ | |
export class Module{ | |
instance:any; | |
constructor( name:string , requires?:string[] = [] , configFn?:any = null ){ | |
this.instance = angular.module( name , requires , configFn ); | |
} | |
config( config:any[] ):Module { | |
this.instance.config( config ); | |
return this; | |
} | |
constant( name:string , obj:any ):Module { | |
this.instance.constant( name , obj ); | |
return this; | |
} | |
controller( name:string , controllerConstructor:any ):Module { | |
this.instance.controller( name , controllerConstructor ); | |
return this; | |
} | |
directive( name:string , directiveFactory:any[] ):Module { | |
this.instance.directive( name , directiveFactory ); | |
return this; | |
} | |
factory( name:string , providerFunction:any ):Module { | |
this.instance.factory( name , providerFunction ); | |
return this; | |
} | |
filter( name:string , filterFactory:any[] ):Module { | |
this.instance.filter( name , filterFactory ); | |
return this; | |
} | |
provider( name:string , providerType:any ):Module { | |
this.instance.provider( name , providerType ); | |
return this; | |
} | |
run( initializationFn:any ):Module { | |
this.instance.run( initializationFn ); | |
return this; | |
} | |
service( name:string , constFn:any ):Module { | |
this.instance.service( name , constFn ); | |
return this; | |
} | |
value( name:string , obj:any ):Module { | |
this.instance.value( name , obj ); | |
return this; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment