Closed NathanWalker closed 8 years ago
@NathanWalker
there was a breaking change in the newest version of angular ...
I think it was a good change overall ... it clears up #item
as an element reference over #item
as a variable (let item
).
ie the for
directive looks like this now:
from:
<nx-list *ngFor="#region of list">
to:
<nx-list *ngFor="let region of list">
Does this relate to the problem above? I've misplaced the link to the changeset in angular.
From the braking-changes log it looks changing
#name="item"
to let-name="item"
might satisfy the parser.
A quick test with rc0
@vakrilov my template seems to bring up undefined for let-nameOfVar
it does satisfy the parser however.
project: https://github.com/matt4446/NS-Angular-GridTest
<StackLayout>
<TextField [(ngModel)]="colsInput" hint="Enter cols"></TextField>
<TextField [(ngModel)]="rowInput" hint="Enter rows"></TextField>
<Button text="Build Grid" (tap)="update()"></Button>
<!-- columns ="*,*,* ... n" effectively -->
<GridLayout [auto-grid-columns]="autoCreateColumns"
[auto-grid-rows]="autoCreateRows">
<template ngFor let-row [ngForOf]="rows" let-y="index">
<template ngFor let-col [ngForOf]="cols" let-x="index">
<Label [col]="col" [row]="row" [text]="x + ',' + y"></Label>
</template>
</template>
</GridLayout>
</StackLayout>
previously template ngFor #row [ngForOf]="rows" #y="index"
a quick test with rc0
and row
, col
, x
,y
all appear to be undefined unlike the older versions of angular with the hash.
My previous example still works correctly in my other project however:
<nx-list *ngFor="let region of list">