Using Object.values() in Stackblitz Angular Project

♀尐吖头ヾ 提交于 2019-12-23 10:18:30

问题


In this stackblitz project we can use Object.values().

I'm trying to use it in this Angular project and it throws:

Property 'values' does not exist on type 'ObjectConstructor'.

I know that in general typescript projects via have to say that it's for a ES2017 environment specifically in TSConfig. Is there some setting in Stackblitz that can be flipped for this?

IIUC Angular should get Object.values from CoreJS.


回答1:


I figured out that to fix that problem you can simply install typescript in stackblitz project dependencies. Just simply write:

npm i typescript

I had exacly the same error and now I have got fully working intellisense. Hope it helps!

Check out on this project:

https://stackblitz.com/edit/angular-validation-errors



来源:https://stackoverflow.com/questions/52372242/using-object-values-in-stackblitz-angular-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!