Reputation: 339
I have updated my angular packages versions as below.
I want to use import {HttpClientModule} from '@angular/common/http';
but I module could not found and even for httpClient also.
See below.
How could I fix this?
Upvotes: 1
Views: 2842
Reputation: 222582
No the actual issue is with the stackblitz
itself,
this is a known bug with type definitions in sub-packages, we have a fix coming for it soon. That code will actually work in the preview btw, it's just the red underline is incorrect!
Upvotes: 0
Reputation: 339
Thanks for the comments. I got the solution.
Actually, I don't know the main reason but the path of http
under @angular/common
is different in my case.
import { HttpClientModule } from '@angular/common/@angular/common/http';
Then it works fine.
Upvotes: 1
Reputation: 241
In your module.ts
import { HttpModule } from '@angular/http';
import { HttpClientModule } from '@angular/common/http';
It should work
Upvotes: 0