Get the current state
After creating a store, you can now consume it into your application. To get the current state, you need to use the copy
method of the store.
import { CounterStore } from 'counter-store';
function YourController($scope, counterStore) {
const counterState = counterStore.copy();
$scope.count = counterState.count;
}
angular
.module('App', [])
.controller('YourController', YourController);
Last updated
Was this helpful?