You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This could help us (start to) break away from the string-only ids for services in 1.x, without waiting for 2.0.
Example declaring an injection point
Foo.$inject=[Storage];// instead of Foo.$inject = ['db'];functionFoo(db){
...
}
Example wiring up the implementation in an angular module:
// These are all meant to be equivalentangular.module('foo',[]).value(Storage,newStorageImpl()).service(Storage,StorageImpl).factory(Storage,function(){returnnewStorageImpl()}).provider(Storage,function(){this.$get=function(){returnnewStorageImpl()};});
I am able to implement this in a library where I generate the string IDs for compatibility with Angular 1.3, but it feels pretty hacky and seems like something Angular core should take care of.
For reference, it ends up looking something like this: