Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat($injector): Allow specifying a decorator on $injector #13103

Closed
wants to merge 1 commit into from

Conversation

lgalfaso
Copy link
Contributor

Allows the definition of a decorator on $injector

@gkalpak
Copy link
Member

gkalpak commented Oct 16, 2015

OOC, what's the usecase ?


it('should allow for decorators to $inject', function() {
injector = createInjector(['ng', function($provide) {
$provide.value('dep', 'dependency');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this used for ? Did you mean for the key to be 'key' or something (to show it gets overwritten).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, this is a leftover

Allows the definition of a decorator on `$injector`
@lgalfaso
Copy link
Contributor Author

OOC, what's the usecase ?

The use case is to allow something that is not defined within an angular module to be injected. This would be useful in projects like ng-upgrade that need to make two different worlds coexist

@@ -688,6 +688,23 @@ describe('injector', function() {
expect(log.join('; ')).
toBe('myDecoratedService:input,dependency1; myService:decInput; dec+origReturn');
});


it('should allow for decorators to $inject', function() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$inject --> $injector (?)
I would probably change it to something like: should allow decorating $injector

@gkalpak
Copy link
Member

gkalpak commented Oct 26, 2015

LGTM (other than a minor nitpick in a test description :))

@lgalfaso lgalfaso closed this in 29a0598 Oct 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants