Type-narrow angular signal in template?

Discussão em 'Angular' iniciado por Sebastian Nielsen, Novembro 26, 2024.

  1. How do you type-narrow angular signals in a template?

    @if (isArray(item())) { // item is a signal
    // item is an array
    item() // typescript currently thinks this is either array or not
    } @else {
    // item is not an array
    item() // typescript currently thinks this is either array or not
    }

    Continue reading...

Compartilhe esta Página