Angular 2 + angular-in-memory-web-api zone GET http://localhost:3000/traceur 404 (Not Found)

后端 未结 4 1018
野的像风
野的像风 2021-02-07 13:20

Hi I have a problem with angular-in-memory-web-api. I tried to use angular2-in-memory-web-api in SystemJS and another solutions her but with no result. I\'m using official quick

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-07 13:36

    Version 0.1.13 of angular2-in-memory-web-api had some breaking changes and it looks like the tutorial has not been updated yet.

    According to the changelog:

    In systemjs.config.js you should change the mapping to:

    'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'

    then delete from packages:

    'angular-in-memory-web-api': {
    main: './index.js',
    defaultExtension: 'js'
    }

    Link to the chang https://github.com/angular/in-memory-web-api/blob/master/CHANGELOG.md#0113-2016-10-20

    An issue has also been filed https://github.com/angular/in-memory-web-api/issues/58

    It says to update app.module.ts by changing

    import { InMemoryWebApiModule } from 'angular-in-memory-web-api/in-memory-web-api.module';

    to

    import { InMemoryWebApiModule } from 'angular-in-memory-web-api';

提交回复
热议问题