Angular2 Tutorial (Tour of Heroes): Cannot find module 'angular2-in-memory-web-api'

前端 未结 29 2246
青春惊慌失措
青春惊慌失措 2020-11-29 06:25

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

29条回答
  •  一整个雨季
    2020-11-29 07:00

    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.

提交回复
热议问题