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

remove dependency to @angular/http #7287

Closed
lucienbertin opened this issue Sep 25, 2017 · 2 comments
Closed

remove dependency to @angular/http #7287

lucienbertin opened this issue Sep 25, 2017 · 2 comments

Comments

@lucienbertin
Copy link

Bug, feature request, or proposal:

remove dependency to @angular/http from the package.json file

What is the expected behavior?

no dependency to @angular/http

What is the current behavior?

has a dependency to @angular/http

What are the steps to reproduce?

ng new testApp
cd testApp
npm install --save @angular/material @angular/cdk
npm uninstall @angular/http --save

make sure your angular version is over 4.3

follow your getting started guide for using your lib

see this error when trying to build

ERROR in ./node_modules/@angular/material/@angular/material.es5.js
Module not found: Error: Can't resolve '@angular/http' in '.\node_modules\@angular\material\@angular'

What is the use-case or motivation for changing an existing behavior?

first of all, none of your components need http, so you shouldn't depend on it

secondly, since version 4.3 of angular, they introduces httpClientModule under @angular/common/http. it's a rewrite of the httpModule of @angular/http with more features (like interceptors, native json parsing, typed response) and easier mocking

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

angular 4.3+ if you want to replace http with httpclient. any angular version if you just wanna remove the dependency

Is there anything else we should know?

this stack overflow answer explain the difference between httpModule and httpClientModule in more details

@crisbeto
Copy link
Member

Will be solved by #6702.

@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants