2017-01-11 97 views
0

我在angular2应用程序中实现了@ngrx,并且在尝试编译打字稿项目时出现了以下错误。错误:(40,20)TS2339:属性'map'在类型'string |预订|书[]'。属性'map'在类型'string'上不存在

Error:(40, 20) TS2339:Property 'map' does not exist on type 'string | Book | Book[]'. Property 'map' does not exist on type 'string'.

我认为错误是关系到这是在NGRX示例应用程序使用的打字稿的联合类型

link to the app

+0

而不是发布链接到您的回购,张贴相关的代码.. – echonax

回答

0

这实在是很难说没有看到你的代码,并获得更多的细节,但它看起来像你试图对Observable返回的对象做一个映射,而不是映射实际的Observable。

0

我有同样的问题。将tsconfig.js中的编译器目标更改为“es6”,解决它。

相关问题