Created
September 16, 2015 16:03
-
-
Save qetr1ck-op/586b2f682b2aed2039e9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module.service = function(name, Class) { | |
provider.provide(name, function() { | |
this.$get = function($injector) { | |
return $injector.instantiate(Class); | |
}; | |
}); | |
} | |
module.factory = function(name, factory) { | |
provider.provide(name, function() { | |
this.$get = function($injector) { | |
return $injector.invoke(factory); | |
}; | |
}); | |
} | |
module.value = function(name, value) { | |
provider.factory(name, function() { | |
return value; | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment