admin管理员组文章数量:1391925
I'm using 0.1.17 of the Angular2 In-Memrory API along with the Angular CLI (with Webpack). I followed all the steps verbatim from the HTTP tutorial and I'm getting the following error:
reflection_capabilities.js:58 Uncaught TypeError: ctorParameters.map is not a function
at ReflectionCapabilities.parameters (http://localhost:4200/main.bundle.js:48626:45)
Here is my app.module.js imports:
imports: [
BrowserModule,
FormsModule,
HttpModule,
AppRoutingModule,
SharedModule,
CoreModule,
// Fake API -- remove for production
InMemoryWebApiModule.forRoot(InMemoryDataService)
],
I'm using 0.1.17 of the Angular2 In-Memrory API along with the Angular CLI (with Webpack). I followed all the steps verbatim from the HTTP tutorial and I'm getting the following error:
reflection_capabilities.js:58 Uncaught TypeError: ctorParameters.map is not a function
at ReflectionCapabilities.parameters (http://localhost:4200/main.bundle.js:48626:45)
Here is my app.module.js imports:
imports: [
BrowserModule,
FormsModule,
HttpModule,
AppRoutingModule,
SharedModule,
CoreModule,
// Fake API -- remove for production
InMemoryWebApiModule.forRoot(InMemoryDataService)
],
Share
Improve this question
asked Dec 12, 2016 at 19:17
Jon GunterJon Gunter
2,1243 gold badges18 silver badges22 bronze badges
3 Answers
Reset to default 4It seems, that your versions don't match. The angular version you are using wants ctorParameters to be an array. But in InMemoryWebApiModule v0.1.17 there is a function provided. Upgrade to v0.2.0. In this version an array is provided.
This bug seems to be linked to some package expecting the version of Angular core to be different than what is actually installed.
I was able to figure out the cause of this issue by looking at the error report from ng build
:
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
This helped me realize that one of my packages expected Angular to be at v2.4.4, but I'm using v2.0.1. I updated my package.json to have both packages set to my core version like this:
"dependencies": {
"@angular/core": "2.0.1",
"@angular/platform-server": "2.0.1",
}
Your issue might not be with @angular/platform-server, but I hope this helps debug it
This error is thrown, when you put wrong sign in a template ==
instead of =
in a parameter assignment.
本文标签: javascriptangularinmemorywebapi ctorParametersmap is not a functionStack Overflow
版权声明:本文标题:javascript - angular-in-memory-web-api: ctorParameters.map is not a function - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744705854a2620839.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论