Skip to content

Commit 706b31f

Browse files
committed
Merge pull request #26 from Foxandxss/scopetypo
Fix the mapping state from the counter example
2 parents 8f258c0 + 87e4811 commit 706b31f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ class CounterController {
5151
/* ngRedux will merge the requested state's slice and actions onto this,
5252
you don't need to redefine them in your controller */
5353

54-
let unsubscribe = $ngRedux.connect(this.mapStateToTarget, CounterActions)(this);
54+
let unsubscribe = $ngRedux.connect(this.mapStateTothis, CounterActions)(this);
5555
$scope.$on('$destroy', unsubscribe);
5656
}
5757

58-
// Which part of the Redux global state does our component want to receive on $scope?
59-
mapStateToTarget(state) {
58+
// Which part of the Redux global state does our component want to receive?
59+
mapStateToThis(state) {
6060
return {
61-
counter: state.counter
61+
value: state.counter
6262
};
6363
}
6464
}

examples/counter/components/counter.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ export default function counter() {
1313
class CounterController {
1414

1515
constructor($ngRedux, $scope) {
16-
const unsubscribe = $ngRedux.connect(this.mapStateToScope, CounterActions)(this);
16+
const unsubscribe = $ngRedux.connect(this.mapStateToThis, CounterActions)(this);
1717
$scope.$on('$destroy', unsubscribe);
1818
}
1919

20-
// Which part of the Redux global state does our component want to receive on $scope?
21-
mapStateToScope(state) {
20+
// Which part of the Redux global state does our component want to receive?
21+
mapStateToThis(state) {
2222
return {
2323
value: state.counter
2424
};

0 commit comments

Comments
 (0)