While action types allow you tell your reducer what action it should take, the payload is the data that your reducer will use to update the state. // reducer.ts export const SECOND = "SECOND"; export const HOUR = "HOUR"; export const c…
When you use ngrx/store and you want to fire a service request. When it sucessfully return the response, you need to dispatch action to tell the store update. So one pattern can be considered to follow is: import {Http, Headers} from '@angular/http';…
How to dispatch a Redux action with a timeout? Q I have an action that updates notification state of my application. Usually this notification will be an error or info of some sort. I need to then dispatch another action after 5 seconds that will ret…
Two-way binding still exists in Angular 2 and ng-model makes it simple. The syntax is a combination of the [input] and (output) syntax to represent that the data is being pushed out and pulled in. import {Component, View, FORM_DIRECTIVES} from "angul…