Reputation: 131
I'm developing an Angular app and am trying to use the Typescript 3.4 feature "const assertion" like this:
const counterSettingsDefaults = { setTo: 10, tickSpeed: 200, increment: 1 } as const;
But I get the compile error:
"Cannot find name 'const'.ts(2304)",
Which indicates to me that this functionality is not available.
Typing ng --version
in powershell gives me the following versions of Angular and Typescript:
Angular: 9.0.0-rc.7
typescript: 3.6.4
What could be wrong, where can I investigate this further?
Upvotes: 0
Views: 2291
Reputation: 457
I found the solution to this problem here. Hurray!
"Open a TypeScript file.
Click the TypeScript version to the bottom right in the Status Bar.
Choose Use Workspace Version from the message box."
Upvotes: 1