Created
March 25, 2018 01:27
-
-
Save peterbsmyth/c43ffc239ed7149df3ec6a00d9e79efb to your computer and use it in GitHub Desktop.
app.component.ts for https://blog.upstate.agency
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, OnInit } from '@angular/core'; | |
import { Store } from '@ngrx/store'; | |
import { LoadPosts } from './post.actions'; | |
import * as fromRoot from './reducers'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent implements OnInit { | |
title = 'app'; | |
constructor( | |
private store: Store<fromRoot.State>, | |
) { | |
} | |
ngOnInit() { | |
this.store.dispatch(new LoadPosts()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment