Trying to figure this out but can't...maybe it's something obvious:
Invocation of the 'todo' component in html:
<div *ngFor="let item of todoLists" class="row">
<div class="col-xl-7 col-lg-7 col-md-12 col-sm-12 col-xs-12 bottom-15">
<todo [listName]="item"></todo>
</div>
</div>
TodoComponent component parameter binding:
export class TodoComponent {
public todoList:Array<any>;
public newTodoText:string = '';
@Input() listName: string;
constructor(private _todoService: TodoService) {
console.log("TodoComponent: constructor");
console.log("TodoComponent: listname - " + this.listName);
this.todoList = this._todoService.getTodoList(this.listName);
}
The listName parameter is always 'undefined'. The TodoComponent gets initialized twice (since I have two lists).
What am I doing wrong here?
Any help is appreciated.