Running Angular project shows error as angular-in-memory-web-api

694 Views Asked by At

My observerable and subscribe class looks like below

Observable

enter image description here

Subscribe

enter image description here

Error

enter image description here

2

There are 2 best solutions below

0
Adrien PESSU On

It seems that you are missing @angular/http package.

You can add it with :

npm install @angular/http

or

yarn @angular/http
0
SHRIKANT PATKI On

First check that you have installed the @angular/http in package.json file. if not then please install it by npm install @angular/http

Always import the HttpClientInMemoryWebApiModule after the HttpClientModule to ensure that the in-memory backend provider supersedes the Angular version.

and also follow the instruction given in the module introduction angular-in-memory-web-api