Created
June 6, 2019 23:00
-
-
Save arturovt/3e607ff5019a056a0d046bb77860aa53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'app-todos', | |
template: ` | |
<app-todo *ngFor="let todo of todos" [todo]="todo"></app-todo> | |
` | |
}) | |
export class TodosComponent { | |
public todos: Todo[] = []; | |
constructor(todoService: TodoService) { | |
todoService.getTodos().subscribe((todos) => { | |
this.todos = todos; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment