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

'unshift' argument for provider's loader #9364

Closed
wants to merge 1 commit into from
Closed

'unshift' argument for provider's loader #9364

wants to merge 1 commit into from

Conversation

mykolaharmash
Copy link

Providers are used in config blocks, but in case when config block invokes before provider, there is no-provider error. This situation may appear when module and config block declared in one file, and provider - in another. Eg.

module.js

angular.module("App", [])

.config(function (fooProvider) {});

foo-provider.js

function fooProvider () {
  return {
    $get: function () {}
  };
}

angular.module("App")
.provider("foo", fooProvider);

Code from module.js always runs first and causes an error. There is fiddle
What do you think?

@mykolaharmash mykolaharmash changed the title 'unshift' argument for provide's loader 'unshift' argument for provider's loader Oct 1, 2014
@gkalpak
Copy link
Member

gkalpak commented Oct 1, 2014

Note that this is a breaking change as detailed here.
I am not sure we want this into 1.2.x.

Related issues: #7139, #7147

@mykolaharmash
Copy link
Author

I'm not sure, but might be that many users will stay on 1.2.x for a while after 1.3 release (maybe IE8 compatibility reason, etc.). Will be useful to fix this to avoid bad practices like described in #7147. Would be cool to implement separate configQueue just like in 1.3.

@tbosch
Copy link
Contributor

tbosch commented Oct 9, 2014

We cannot backport the fix as this would be a breaking change, sorry. Please update to 1.3.x...

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.

4 participants