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

fix($injector): throw when factory $get method does not return a value #9210

Closed
wants to merge 1 commit into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Sep 22, 2014

BREAKING CHANGE:

Previously, not returning a value would fail silently, and an application
trying to inject the value owuld inject an undefined value, quite possibly
leading to a TypeError. Now, the application will fail entirely, and a reason
will be given.

Closes #4575

@caitp
Copy link
Contributor Author

caitp commented Sep 22, 2014

Going through old issues assigned to me --- PTAL

BREAKING CHANGE:

Previously, not returning a value would fail silently, and an application trying to inject the
value owuld inject an undefined value, quite possibly leading to a TypeError. Now, the application
will fail entirely, and a reason will be given.

Closes angular#4575
}
};
});
```
Copy link
Contributor

Choose a reason for hiding this comment

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

missing EOL

@btford
Copy link
Contributor

btford commented Sep 30, 2014

I like this change from a usability perspective, but I'm not sure if it's worth the few extra bytes. @IgorMinar what do you think?

@btford btford modified the milestones: 1.3.0-rc.5, 1.3.0 Sep 30, 2014
@IgorMinar
Copy link
Contributor

this looks good to me.

@btford
Copy link
Contributor

btford commented Oct 8, 2014

👏

bullgare pushed a commit to bullgare/angular.js that referenced this pull request Oct 9, 2014
BREAKING CHANGE:

Previously, not returning a value would fail silently, and an application trying to inject the
value owuld inject an undefined value, quite possibly leading to a TypeError. Now, the application
will fail entirely, and a reason will be given.

Closes angular#4575
Closes angular#9210
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Factory that doesn't return an object silently inject null
4 participants