Skip to main content
denoise https://meta.stackexchange.com/q/131009/997587
Source Link
starball
  • 59.6k
  • 53
  • 315
  • 1k

Since this is at least the third time I've wasted more than 5 min on this problem I figured I'd post the Q & A. I hope it helps someone else down the road... probably me!

I typed in instead of of in the ngFor expression.

Befor 2-beta.17, it should be:

<div *ngFor="#talk of talks"> 

As of beta.17, use the let syntax instead of #. See the UPDATE further down for more info.


Note that the ngFor syntax "desugars" into the following:

<template ngFor #talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor #talk [ngForIn]="talks"> <div>...</div> </template> 

Since ngForIn isn't an attribute directive with an input property of the same name (like ngIf), Angular then tries to see if it is a (known native) property of the template element, and it isn't, hence the error.

UPDATE - as of 2-beta.17, use the let syntax instead of #. This updates to the following:

<div *ngFor="let talk of talks"> 

Note that the ngFor syntax "desugars" into the following:

<template ngFor let-talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor let-talk [ngForIn]="talks"> <div>...</div> </template> 

Since this is at least the third time I've wasted more than 5 min on this problem I figured I'd post the Q & A. I hope it helps someone else down the road... probably me!

I typed in instead of of in the ngFor expression.

Befor 2-beta.17, it should be:

<div *ngFor="#talk of talks"> 

As of beta.17, use the let syntax instead of #. See the UPDATE further down for more info.


Note that the ngFor syntax "desugars" into the following:

<template ngFor #talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor #talk [ngForIn]="talks"> <div>...</div> </template> 

Since ngForIn isn't an attribute directive with an input property of the same name (like ngIf), Angular then tries to see if it is a (known native) property of the template element, and it isn't, hence the error.

UPDATE - as of 2-beta.17, use the let syntax instead of #. This updates to the following:

<div *ngFor="let talk of talks"> 

Note that the ngFor syntax "desugars" into the following:

<template ngFor let-talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor let-talk [ngForIn]="talks"> <div>...</div> </template> 

I typed in instead of of in the ngFor expression.

Befor 2-beta.17, it should be:

<div *ngFor="#talk of talks"> 

As of beta.17, use the let syntax instead of #. See the UPDATE further down for more info.


Note that the ngFor syntax "desugars" into the following:

<template ngFor #talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor #talk [ngForIn]="talks"> <div>...</div> </template> 

Since ngForIn isn't an attribute directive with an input property of the same name (like ngIf), Angular then tries to see if it is a (known native) property of the template element, and it isn't, hence the error.

UPDATE - as of 2-beta.17, use the let syntax instead of #. This updates to the following:

<div *ngFor="let talk of talks"> 

Note that the ngFor syntax "desugars" into the following:

<template ngFor let-talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor let-talk [ngForIn]="talks"> <div>...</div> </template> 
added 2 characters in body
Source Link
Liam
  • 30k
  • 28
  • 143
  • 206

Since this is at least the third time I've wasted more than 5 min on this problem I figured I'd post the Q & A. I hope it helps someone else down the road... probably me!

I typed in instead of of in the ngFor expression.

Befor 2-beta.17, it should be:

<div *ngFor="#talk of talks"> 
<div *ngFor="#talk of talks"> 

As of beta.17, use the let syntax instead of #. See the UPDATE further down for more info.


Note that the ngFor syntax "desugars" into the following:

<template ngFor #talk [ngForOf]="talks"> <div>...</div> </template> 
<template ngFor #talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor #talk [ngForIn]="talks"> <div>...</div> </template> 
<template ngFor #talk [ngForIn]="talks"> <div>...</div> </template> 

Since ngForIn isn't an attribute directive with an input property of the same name (like ngIf), Angular then tries to see if it is a (known native) property of the template element, and it isn't, hence the error.

UPDATE - as of 2-beta.17, use the let syntax instead of #. This updates to the following:

<div *ngFor="let talk of talks"> 
<div *ngFor="let talk of talks"> 

Note that the ngFor syntax "desugars" into the following:

<template ngFor let-talk [ngForOf]="talks"> <div>...</div> </template> 
<template ngFor let-talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor let-talk [ngForIn]="talks"> <div>...</div> </template> 
<template ngFor let-talk [ngForIn]="talks"> <div>...</div> </template> 

Since this is at least the third time I've wasted more than 5 min on this problem I figured I'd post the Q & A. I hope it helps someone else down the road... probably me!

I typed in instead of of in the ngFor expression.

Befor 2-beta.17, it should be:

<div *ngFor="#talk of talks"> 

As of beta.17, use the let syntax instead of #. See the UPDATE further down for more info.


Note that the ngFor syntax "desugars" into the following:

<template ngFor #talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor #talk [ngForIn]="talks"> <div>...</div> </template> 

Since ngForIn isn't an attribute directive with an input property of the same name (like ngIf), Angular then tries to see if it is a (known native) property of the template element, and it isn't, hence the error.

UPDATE - as of 2-beta.17, use the let syntax instead of #. This updates to the following:

<div *ngFor="let talk of talks"> 

Note that the ngFor syntax "desugars" into the following:

<template ngFor let-talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor let-talk [ngForIn]="talks"> <div>...</div> </template> 

Since this is at least the third time I've wasted more than 5 min on this problem I figured I'd post the Q & A. I hope it helps someone else down the road... probably me!

I typed in instead of of in the ngFor expression.

Befor 2-beta.17, it should be:

<div *ngFor="#talk of talks"> 

As of beta.17, use the let syntax instead of #. See the UPDATE further down for more info.


Note that the ngFor syntax "desugars" into the following:

<template ngFor #talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor #talk [ngForIn]="talks"> <div>...</div> </template> 

Since ngForIn isn't an attribute directive with an input property of the same name (like ngIf), Angular then tries to see if it is a (known native) property of the template element, and it isn't, hence the error.

UPDATE - as of 2-beta.17, use the let syntax instead of #. This updates to the following:

<div *ngFor="let talk of talks"> 

Note that the ngFor syntax "desugars" into the following:

<template ngFor let-talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor let-talk [ngForIn]="talks"> <div>...</div> </template> 
It's just Angular.
Source Link
Lazar Ljubenović
  • 19.9k
  • 10
  • 58
  • 95

Since this is at least the third time I've wasted more than 5 min on this problem I figured I'd post the Q & A. I hope it helps someone else down the road... probably me!

I typed in instead of of in the ngFor expression.

Pre betaBefor 2-beta.17, it should be:

<div *ngFor="#talk of talks"> 

As of beta.17, use the let syntax instead of #. See the UPDATE further down for more info.


Note that the ngFor syntax "desugars" into the following:

<template ngFor #talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor #talk [ngForIn]="talks"> <div>...</div> </template> 

Since ngForIn isn't an attribute directive with an input property of the same name (like ngIf), Angular then tries to see if it is a (known native) property of the template element, and it isn't, hence the error.

UPDATE - as of beta2-beta.17, use the let syntax instead of #. This updates to the following:

<div *ngFor="let talk of talks"> 

Note that the ngFor syntax "desugars" into the following:

<template ngFor let-talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor let-talk [ngForIn]="talks"> <div>...</div> </template> 

Since this is at least the third time I've wasted more than 5 min on this problem I figured I'd post the Q & A. I hope it helps someone else down the road... probably me!

I typed in instead of of in the ngFor expression.

Pre beta.17, it should be:

<div *ngFor="#talk of talks"> 

As of beta.17, use the let syntax instead of #. See the UPDATE further down for more info.


Note that the ngFor syntax "desugars" into the following:

<template ngFor #talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor #talk [ngForIn]="talks"> <div>...</div> </template> 

Since ngForIn isn't an attribute directive with an input property of the same name (like ngIf), Angular then tries to see if it is a (known native) property of the template element, and it isn't, hence the error.

UPDATE - as of beta.17, use the let syntax instead of #. This updates to the following:

<div *ngFor="let talk of talks"> 

Note that the ngFor syntax "desugars" into the following:

<template ngFor let-talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor let-talk [ngForIn]="talks"> <div>...</div> </template> 

Since this is at least the third time I've wasted more than 5 min on this problem I figured I'd post the Q & A. I hope it helps someone else down the road... probably me!

I typed in instead of of in the ngFor expression.

Befor 2-beta.17, it should be:

<div *ngFor="#talk of talks"> 

As of beta.17, use the let syntax instead of #. See the UPDATE further down for more info.


Note that the ngFor syntax "desugars" into the following:

<template ngFor #talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor #talk [ngForIn]="talks"> <div>...</div> </template> 

Since ngForIn isn't an attribute directive with an input property of the same name (like ngIf), Angular then tries to see if it is a (known native) property of the template element, and it isn't, hence the error.

UPDATE - as of 2-beta.17, use the let syntax instead of #. This updates to the following:

<div *ngFor="let talk of talks"> 

Note that the ngFor syntax "desugars" into the following:

<template ngFor let-talk [ngForOf]="talks"> <div>...</div> </template> 

If we use in instead, it turns into

<template ngFor let-talk [ngForIn]="talks"> <div>...</div> </template> 
Making it clearer what the actual syntax should be, as pre beta.17 is quite old, and this answer is quite popular.
Source Link
Loading
revert so the comments make sense, and so the original pre-beta 17 syntax remains in the question. updated syntax is also present and noted as such.
Source Link
ps2goat
  • 8.5k
  • 1
  • 39
  • 74
Loading
deleted 58 characters in body
Source Link
Mark Rajcok
  • 365k
  • 114
  • 501
  • 494
Loading
added 6 characters in body
Source Link
Mark Rajcok
  • 365k
  • 114
  • 501
  • 494
Loading
added 191 characters in body
Source Link
Mark Rajcok
  • 365k
  • 114
  • 501
  • 494
Loading
Source Link
Mark Rajcok
  • 365k
  • 114
  • 501
  • 494
Loading