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

in 1.3.0-rc5 'this' is undefined in service's factory call #9511

Closed
amaillere opened this issue Oct 9, 2014 · 0 comments
Closed

in 1.3.0-rc5 'this' is undefined in service's factory call #9511

amaillere opened this issue Oct 9, 2014 · 0 comments

Comments

@amaillere
Copy link

new enforceReturnValue feature in 1.3.0-rc5 0d3b69a results in 'this' being undefined in factory call :

angular.module('users').factory('Authentication', [
    function() {
        var _this = this;
        _this._data = {  // ERROR HERE 
            user: window.user
        };
        return _this._data;
    }
]);
caitp added a commit to caitp/angular.js that referenced this issue Oct 9, 2014
0d3b69a broke this by calling $get with an undefined
context, which in strict mode would be undefined. This fixes this by ensuring that the
provider is used as the context, as it was originally.

Closes angular#9511
Closes angular#9512
@caitp caitp closed this as completed in 372fa69 Oct 9, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants