InMemoryWebApiModule 正在使用下载的源代码,
"angular-in-memory-web-api": "~0.5.0"
但"angular-in-memory-web-api": "^0.6.0"
我没有按照教程安装 angular-in-memory-web-api :
npm install angular-in-memory-web-api --save
它安装了"angular-in-memory-web-api": "^0.6.0"
错误信息:
webpack-internal:///./src/app/hero.service.ts:87
Object
body:
error: "Object(...) is not a function"
__proto__: Object
headers: HttpHeaders
lazyInit: ƒ ()
lazyUpdate: null
normalizedNames: Map(0) {}
__proto__: Object
status: 500statusText: "Internal Server Error"
url: "api/heroes"
__proto__: Object
(anonymous) @ webpack-internal:///./src/app/hero.service.ts:87