cannot cannot find '@angular/http' in angular CLI version 7.1.0., Also http not present in package.json
-
what do you mean by angular CLI version?Sajeetharan– Sajeetharan2018-12-02 08:10:28 +00:00Commented Dec 2, 2018 at 8:10
-
It's deprecated since version 4.3 of Angular. Why do you still want to use that? Use the documented HttpClient. angular.io/guide/httpJB Nizet– JB Nizet2018-12-02 08:29:45 +00:00Commented Dec 2, 2018 at 8:29
Add a comment
|
2 Answers
'@angular/http' is depricated and in version 7 is now removed from the generated package.json file,use HttpClient from '@angular/common/http'.
Import in app.module.ts
import { HttpClientModule } from '@angular/common/http';
@NgModule({
imports: [
// import HttpClientModule
HttpClientModule,
]