August 2017
Beginner
374 pages
10h 41m
English
Now we can use ng-redux in our controller.
app.controller('posts', ($ngRedux, $scope) => {
In addition to $scope, we now also have $ngRedux available in our controller. ng-redux provides a connect function with the following signature: $ngRedux.connect(mapStateToTarget, mapDispatchToTarget)(target)
Similar to calling store.subscribe(), the ng-redux connect function returns an unsubscribe function.
const mapState = (state) => { return { posts: state.posts } }
Read now
Unlock full access