Last active
January 19, 2016 02:15
-
-
Save MikeRyanDev/b3daada349888812057c to your computer and use it in GitHub Desktop.
This file contains 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 'angular2/core'; | |
import {Observable} from 'rxjs'; | |
import {Store} from '@ngrx/store'; | |
interface ITodoState{ | |
todos: string[]; | |
} | |
@Component({ | |
selector: 'todo-list', | |
template: ` | |
<ol> | |
<li *ngFor="#todo of todos$ | async">{{ todo }}</li> | |
</ol> | |
` | |
}) | |
class TodoList{ | |
todos$: Observable<string[]>; | |
constructor(store: Store<ITodoState>){ | |
this.todos$ = store.select(state => state.todos); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment