npmangular95% confidence\u2191 360

Exception: Can't bind to 'ngFor' since it isn't a known native property

Full error message
What am I doing wrong?

import {bootstrap, Component} from 'angular2/angular2'

@Component({
  selector: 'conf-talks',
  template: `<div *ngFor="talk of talks">
     {{talk.title}} by {{talk.speaker}}
     <p>{{talk.description}}
   </div>`
})
class ConfTalks {
  talks = [ {title: 't1', speaker: 'Brian', description: 'talk 1'},
            {title: 't2', speaker: 'Julie', description: 'talk 2'}];
}
@Component({
  selector: 'my-app',
  directives: [ConfTalks],
  template: '<conf-talks></conf-talks>'
})
class App {}
bootstrap(App, [])

The error is

EXCEPTION: Template parse errors:
Can't bind to 'ngFor' since it isn't a known native property
("<div [ERROR ->]*ngFor="talk of talks">

I missed let in front of talk: <div *ngFor="let talk of talks"> Note that as of beta.17 usage of #... to declare local variables inside of structural directives like NgFor is deprecated. Use let instead. <div *ngFor="#talk of talks"> now becomes <div *ngFor="let talk of talks"> Original answer: I missed # in front of talk: <div *ngFor="#talk of talks"> It is so easy to forget that #. I wish the Angular exception error message would instead say: you forgot that # again.

API access

Get this solution programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/error/b6b25088abf5b890784726f5afe1c72ebf503d0e57cfb15efb436561e1bdbfb0
hash \u00b7 b6b25088abf5b890784726f5afe1c72ebf503d0e57cfb15efb436561e1bdbfb0
Exception: Can&#39;t bind to &#39;ngFor&#39; since it isn&#3… — DepScope fix | DepScope