Updating tsconfig.json target target to "es2022" causes "Property 'xx' is used before its...

Discussão em 'Angular' iniciado por peterc, Setembro 26, 2024.

  1. peterc

    peterc Guest

    I have a lot of Angular code where I assign a property at its definition like the following...

    public errors$ = this.store$.select(fromApp.getErrors);

    constructor(private store$: Store<MyState>


    As we can see store$ is injected via the constructor. But now after changing tsconfig.json target target to "es2022" I get the error

    Property 'store$' is used before its initialization.ts(2729)


    Are we still able to assign such properties at the declaration?

    Continue reading...

Compartilhe esta Página