Reputation: 829
I try to create a new service file on Stackblitz, for some reason I get an error message: Can't find module '@angular/common/http'
Same with 'rxjs/Observable'; any idea why? It uses now Angular 6.
I have the @angular/http under npm packages
Thanks.
Upvotes: 1
Views: 1457
Reputation: 15353
You need to add the @angular/http
package to the dependencies.
Then in your main module:
import { HttpClientModule } from '@angular/common/http';
@NgModule({
imports: [ ..., HttpClientModule],
...
})
It's rxjs 6, imports are simplified:
import { Observable } from 'rxjs'
Upvotes: 4