Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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)
  ],
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
396 views
Welcome To Ask or Share your Answers For Others

1 Answer

It 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...