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

前端 未结 29 2300
青春惊慌失措
青春惊慌失措 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:02

    Try adding the typescript definitions:

    sudo typings install --save file:./node_modules/angular2-in-memory-web-api/in-memory-backend.service.d.ts
    

    ... specifying the dependency name:

    angular2-in-memory-web-api
    

    Then add the entry point for "angular2-in-memory-web-api" in /systemjs.config.js

    var packages = {
      ...
      'angular2-in-memory-web-api': { main: 'core.js', defaultExtension: 'js' }
    };
    

提交回复
热议问题