My observerable and subscribe class looks like below
Observable
Subscribe
Error
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