Skip to content

Commit b222774

Browse files
committed
Change vm for something else
1 parent 793ba48 commit b222774

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<div>
2-
<p>Clicked: {{vm.counter}} times </p>
2+
<p>Clicked: {{counter.value}} times </p>
33

4-
<button ng-click='vm.increment()'>+</button>
5-
<button ng-click='vm.decrement()'>-</button>
6-
<button ng-click='vm.incrementIfOdd()'>Increment if odd</button>
7-
<button ng-click='vm.incrementAsync()'>Increment Async</button>
4+
<button ng-click='counter.increment()'>+</button>
5+
<button ng-click='counter.decrement()'>-</button>
6+
<button ng-click='counter.incrementIfOdd()'>Increment if odd</button>
7+
<button ng-click='counter.incrementAsync()'>Increment Async</button>
88
</div>

examples/counter/components/counter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as CounterActions from '../actions/counter';
33
export default function counter() {
44
return {
55
restrict: 'E',
6-
controllerAs: 'vm',
6+
controllerAs: 'counter',
77
controller: CounterController,
88
template: require('./counter.html'),
99
scope: {}
@@ -20,7 +20,7 @@ class CounterController {
2020
// Which part of the Redux global state does our component want to receive on $scope?
2121
mapStateToScope(state) {
2222
return {
23-
counter: state.counter
23+
value: state.counter
2424
};
2525
}
2626
}

0 commit comments

Comments
 (0)