angular 18 - @let syntax in templates

Discussão em 'Angular' iniciado por Pieterjan, Abril 7, 2025.

  1. Pieterjan

    Pieterjan Guest

    The Angular team just implemented the new @let syntax in templates. According to this comment it's implemented in this commit, which should already be released in version 18.0.2

    [​IMG] [​IMG] [​IMG] [​IMG]

    I updated my NX workspace to use @angular/compiler 18.0.2 (npm update)

    [​IMG]

    However it's still not working. I'm still getting the following error:

    X [ERROR] NG5002: Incomplete block "let showSpan". If you meant to write the @ character, you should use the "@" HTML entity instead. [plugin angular-compiler]

    libs/example-ng-bootstrap/calendar/src/calendar.component.html:32:16:
    32 │ @let showSpan = (day !== null) && day.isInMonth;
    ╵ ~~~~~~~~~~~~~~

    Error occurs in the template of component BsCalendarComponent.

    libs/example-ng-bootstrap/calendar/src/calendar.component.ts:14:15:
    14 │ templateUrl: './calendar.component.html',
    ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~


    So what am I doing wrong?

    Continue reading...

Compartilhe esta Página