Created
November 5, 2014 11:31
-
-
Save stevenh77/1c41c50a4181f0d516d1 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
| provider.service = function(name, Class) { | |
| provider.provide(name, function() { | |
| this.$get = function($injector) { | |
| return $injector.instantiate(Class); | |
| }; | |
| }); | |
| } | |
| provider.factory = function(name, factory) { | |
| provider.provide(name, function() { | |
| this.$get = function($injector) { | |
| return $injector.invoke(factory); | |
| }; | |
| }); | |
| } | |
| provider.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