1

According to this answer we should set the following compilerOptions and it should work, however no love:

  "compilerOptions": {
    ...
    "target": "ES2021",
    "lib": ["es2021", "dom", "esnext.string", "es2021.string"],    ...
  },

This is a Stackblitz demo. Thoughts?

Ole
  • 41,793
  • 59
  • 191
  • 359

1 Answers1

1

That's pretty weird indeed.

And the fix doesn't seem obvious.

A dirty option could be to add in your .ts. But I'm not a fan of this 'hack'

/// <reference lib="es2022" />
Wandrille
  • 6,267
  • 3
  • 20
  • 43
  • You want `"lib": ["es2021.string"]` – Aluan Haddad Apr 28 '23 at 13:16
  • Yeah I ended up just using `split` and `join` instead ... which was fine for my use case ... Aluan I tried adding `es2021.string`, but still no love ... see the updated demo ... https://stackblitz.com/edit/angular-rpzfjn?file=src%2Fmain.ts,tsconfig.json – Ole Apr 28 '23 at 15:50