Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Multi Provider dependency order #23059

Closed
trollkotze opened this issue Mar 29, 2018 · 3 comments
Closed

[Doc] Multi Provider dependency order #23059

trollkotze opened this issue Mar 29, 2018 · 3 comments
Labels
area: core Issues related to the framework runtime core: di feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature: votes required Feature request which is currently still in the voting phase feature Issue that requests a new feature freq2: medium P4 A relatively minor issue that is not relevant to core functions
Milestone

Comments

@trollkotze
Copy link

trollkotze commented Mar 29, 2018


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Questions like this are unanswered. Nobody knows, or at least it seems so to me, and I cannot find relevant documentation.

Expected behavior

Would be good to find straightforward information about this in the documentation.

Minimal reproduction of the problem with instructions

My problem is as follows:
I want to use a custom AuthInterceptor for use with HttpClientModule, but also need the JsonpInterceptor from HttpClientJsonpModule.

I am doing like so in my AppModule:

    imports: [
        ...,
        HttpClientJsonpModule // this provides JsonpInterceptor to the HTTP_INTERCEPTORS token
        ...
    ],
    providers: [
        ...,
        { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptorService, multi: true },
        ...,
    ],

But order of injection is important here!
I don't know how to control the order of injection for the HTTP_INTERCEPTORS multi-provider.
In my scenario it seems to happen so that the JsonpInterceptor provided by HttpClientJsonpModule is added first to the HTTP_INTERCEPTORS, which means, it will be called first in the chain of interceptors. I want exactly the opposite, because the JsonpInterceptor will not call next() to let any other interceptors run through if it finds a jsonp request. But I don't know a way to change the order.

What is the motivation / use case for changing the behavior?

Inform developers better so that they don't have to waste so much time searching and reading the angular core code to find andswers. Because time is valuable.

Environment


Angular version: 5.2.9

Browser:
[x] not a browser issue
 
For Tooling issues:
- Node version: v9.2.0, but shouldn't matter
- Platform:  Linux, but really shouldn't matter
@ngbot ngbot bot added this to the needsTriage milestone Mar 29, 2018
@IgorMinar IgorMinar added area: core Issues related to the framework runtime comp: docs labels Mar 29, 2018
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Mar 29, 2018
@jelbourn jelbourn added P4 A relatively minor issue that is not relevant to core functions and removed severity2: inconvenient labels Oct 1, 2020
@angular-robot
Copy link
Contributor

angular-robot bot commented Jun 4, 2021

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

@angular-robot angular-robot bot added the feature: votes required Feature request which is currently still in the voting phase label Jun 4, 2021
@angular-robot
Copy link
Contributor

angular-robot bot commented Jun 24, 2021

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

@angular-robot angular-robot bot added the feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors label Jun 24, 2021
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime core: di feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature: votes required Feature request which is currently still in the voting phase feature Issue that requests a new feature freq2: medium P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

No branches or pull requests

7 participants