In Angular 2 ngFor, is it possible to declare a local (short) variable? I mean something like this, but I'm not sure about the syntax:
<li *ngFor="let userHasAgenda of agendas | async;
let agenda=userHasAgenda.agenda">
The estimated hypothetical part: let agenda=userHasAgenda.agenda
. Trying something like this, Angular gives me:
Parser Error: Unexpected token ., expected identifier, keyword, or string at column 43 in [let uha of agendas | async; let agenda=uha.agenda;]
Edit 1: For comparison, I know this is possible, for example, with index / first / last:
<li *ngFor="let task of tasks | async;
let i = index;
let isFirst = first;
let isLast = last;"
But is it allowed to have custom "aliases"?
source
share