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

refactor(http): Removed deprecated HTTP_PROVIDERS and JSONP_PROVIDERS #10864

Merged
merged 1 commit into from
Aug 17, 2016

Conversation

chuckjaz
Copy link
Contributor

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[x] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

The http module exports HTTP_PROVIDERS and JSONP_PROVIDERS that need to be removed.

What is the new behavior?

The previously deprecated HTTP_PROVIDERS and JSONP_PROVIDERS are removed.

Does this PR introduce a breaking change? (check one with "x")

[x] Yes
[ ] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

The previously deprecated HTTP_PROVIDERS and JSONP_PROVIDERS are removed.

Other information:

BREAKING CHANGE: previously deprecated HTTP_PROVIDERS and JSONP_PROVIDERS were removed; see deprecation notice for migration instructions.

BREAKING CHANGE: previously deprecated HTTP_PROVIDERS and JSONP_PROVIDERS were removed; see deprecation notice for migration instructions.
@chuckjaz chuckjaz added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 16, 2016
@IgorMinar IgorMinar added pr_state: LGTM action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Aug 16, 2016
@vikerman vikerman merged commit 675e582 into angular:master Aug 17, 2016
@robertlevy
Copy link

can you provide a link to the deprecation notice for this?

@dagilleland
Copy link

The deprecation notice in the release notes says that it is deprecated, but gives no guidance as to what we should replace it with.

Specifically, I have discovered that the migration guidance should be:

  1. Remove HTTP_PROVIDERS and JSONP_PROVIDERS from your application module
  2. Use the HttpModule and JsonpModule in your application module's imports.

e.g.: Instead of this

@NgModule({
  declarations: [AppComponent],

  providers:    [
    HTTP_PROVIDERS,
    JSONP_PROVIDERS,
      ],
   ...
})
export class AppModule { }

use this

@NgModule({
  declarations: [AppComponent],

  imports: [
    HttpModule,
    JsonpModule
  ],
   ...
})
export class AppModule { }

@maartentibau
Copy link
Contributor

maartentibau commented Sep 12, 2016

Could you also provide an example if you want to "overwrite" the HTTP_PROVIDERS from the HttpModule?

e.g. in my RC.4 app I had this custom provider.

import {ReflectiveInjector} from '@angular/core';
import {Http, HTTP_PROVIDERS} from '@angular/http';
import {HttpAuth} from '../services/http-auth.service';

let relativeInjector = ReflectiveInjector.resolveAndCreate([HTTP_PROVIDERS]);
let http = relativeInjector.get(Http);

export const HTTP_AUTH_PROVIDERS: any[] = [
  {provide: 'httpAuth', useValue: http},
  {provide: Http, useClass: HttpAuth},
];

That way the original HTTP_PROVIDERS could be overwritten and I could inject my own HTTP_AUTH_PROVIDERS in the main.ts and still use the normal import {Http} from '@angular/http'; statement in my other services.

hbkrunal pushed a commit to hbkrunal/angular that referenced this pull request Sep 15, 2016
…angular#10864)

BREAKING CHANGE: previously deprecated HTTP_PROVIDERS and JSONP_PROVIDERS were removed; see deprecation notice for migration instructions.
@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 Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants