Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
todo-list.component.ts
export class TodoListComponent implements OnInit {
public selectedTodo$ = this.todoListSandboxService.selectedTodo$;
public todoList: TodoItem[];
public isLoading = false;
constructor(private todoListSandboxService: TodoListSandboxService) {}
public ngOnInit(): void {
// mapping to state property - don't do this!
this.todoListSandboxService.todoList$.subscribe(todoList => {
this.todoList = todoList;
});
this.todoListSandboxService.isLoading$.subscribe(isLoading => {
this.isLoading = isLoading;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.