Skip to content

Instantly share code, notes, and snippets.

@MikeRyanDev
Last active January 19, 2016 02:15
Show Gist options
  • Save MikeRyanDev/b3daada349888812057c to your computer and use it in GitHub Desktop.
Save MikeRyanDev/b3daada349888812057c to your computer and use it in GitHub Desktop.
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