NetanelBasal
2/22/2017 - 2:20 PM

app.component.ts

import { Component } from '@angular/core';
import { Store } from "@ngrx/store";
import { Observable } from "rxjs";
import { getTodos } from "./app.module";

@Component({
  selector: 'app-root',
  templateUrl: `
    <todos [todos]="todos | async"></todos>
  `
})
export class AppComponent {
  todos : Observable<any>;

  constructor( private store : Store<any> ) {
    this.store.dispatch(getTodos());
    this.todos = store.select("todos");
  }
}