Skip to content

Instantly share code, notes, and snippets.

@Tecayehuatl
Created May 25, 2020 05:19
Show Gist options
  • Save Tecayehuatl/ade6563749f1c2d889d27bd639e4f6e4 to your computer and use it in GitHub Desktop.
Save Tecayehuatl/ade6563749f1c2d889d27bd639e4f6e4 to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
import { Store } from '@ngrx/store';
import { IAppState } from './store/app.interface';
import { login } from './store/actions/app.actions';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
title = 'ngrx-store-walkthrough';
constructor(private store: Store<IAppState>) {}
login(): void {
this.store.dispatch(login({ usernamae: 'username', password: 'password' }));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment