"This kind of expression is always falsy" error in angular template

Discussão em 'Angular' iniciado por Carrm, Outubro 21, 2024.

  1. Carrm

    Carrm Guest

    I've updated my dependencies lately and I now have the error "this kind of expression is always falsy" when I use the ?. operator in HTML templates. For example:

    <app-configuration-panel [configuration]="currentApp?.configuration" />


    This code works and compiles, my editor is the only one complaining about the syntax.

    Quick note: I use Sublime Text with LSP (eslint/angular), if I open my project with VS Code I don't have any error. My guess is that VSCode might use a different Typescript version than the one configured in my package.json. I'm currently using TS 5.5.4 and Angular 18.2.8

    Is there a way to ignore this specific error? I still want to have the other errors/warnings in my templates and so far I've only seen solutions that turn off the whole thing.

    Continue reading...

Compartilhe esta Página