I have followed the Tutorial. After changing app/maint.ts
in the Http chapter I get the error when starting the app via command line:
ap
I create my project using angular-cli and i set in package.json "angular-in-memory-web-api": "^0.2.4" in dependences block and then i run npm install.
Work for me :D
import { InMemoryBackendService, SEED_DATA } from 'angular2-in-memory-web-api';
import { InMemoryDataService } from './in-memory-data.service';
The InMemoryDataService
class doesn't come under any API. We need to create a service class and then import that service class into app.module.ts file.
I am using angular 4 and below solved my problem.
npm install angular-in-memory-web-api --save
This was a real stinker. Thanks to @traneHead, @toni and others, these steps worked for me.
angular2-in-memory-web-api
to 0.0.10
systemjs.config.js
:angular2-in-memory-web-api': { main: 'core.js', defaultExtension: 'js' }
I had the same problem, I changed in systemjs.config :
'angular2-in-memory-web-api': { defaultExtension: 'js' },
By this line :
'angular2-in-memory-web-api': { main: 'core.js', defaultExtension: 'js' },
I solved it copying index.js
and index.d.ts
to core.js
and core.d.ts
, that is, inside node_modules/angular2-in-memory-web-api
folder. Go figure out.