Search code examples
angulartypescriptstackblitz

Using Object.values() in Stackblitz Angular Project


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.


Solution

  • 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