Skip to content

Instantly share code, notes, and snippets.

@peterbsmyth
Created March 25, 2018 01:27
Show Gist options
  • Save peterbsmyth/c43ffc239ed7149df3ec6a00d9e79efb to your computer and use it in GitHub Desktop.
Save peterbsmyth/c43ffc239ed7149df3ec6a00d9e79efb to your computer and use it in GitHub Desktop.
app.component.ts for https://blog.upstate.agency
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