Using the angular quickstart app (https://github.com/angular/quickstart/blob/master/README.md). Using angular 2.1.1
Using *ngFor, the first item of the list doesn\'t app
I don't see any issue, I tried this in this Plunker! and it works.
import { Component,Input } from '@angular/core';
@Component({
selector: 'my-app',
template: `Angular 2 First Item in Array Missing using *ngFor
{{teachers | json}}
`
})
export class AppComponent {
public teachers: string[] = [
"Erty",
"Dave",
"Sarah",
"Walter"
];
}
@Component({
selector: 'teacher',
template: `
Teacher {{index}}: {{teacherName}}
`
})
export class TeacherComponent {
@Input() teacherName: string;
@Input() index: number;
ngOnInit() {
console.log(this.teacherName);
}
}