File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed
examples/counter/components Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -66,11 +66,11 @@ class CounterController {
66
66
67
67
``` HTML
68
68
<div >
69
- <p >Clicked: {{vm. counter}} times </p >
70
- <button ng-click =' vm .increment()' >+</button >
71
- <button ng-click =' vm .decrement()' >-</button >
72
- <button ng-click =' vm .incrementIfOdd()' >Increment if odd</button >
73
- <button ng-click =' vm .incrementAsync()' >Increment Async</button >
69
+ <p >Clicked: {{counter.value }} times </p >
70
+ <button ng-click =' counter .increment()' >+</button >
71
+ <button ng-click =' counter .decrement()' >-</button >
72
+ <button ng-click =' counter .incrementIfOdd()' >Increment if odd</button >
73
+ <button ng-click =' counter .incrementAsync()' >Increment Async</button >
74
74
</div >
75
75
```
76
76
Original file line number Diff line number Diff line change 1
1
< div >
2
- < p > Clicked: {{vm. counter}} times </ p >
2
+ < p > Clicked: {{counter.value }} times </ p >
3
3
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 >
8
8
</ div >
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import * as CounterActions from '../actions/counter';
3
3
export default function counter ( ) {
4
4
return {
5
5
restrict : 'E' ,
6
- controllerAs : 'vm ' ,
6
+ controllerAs : 'counter ' ,
7
7
controller : CounterController ,
8
8
template : require ( './counter.html' ) ,
9
9
scope : { }
@@ -20,7 +20,7 @@ class CounterController {
20
20
// Which part of the Redux global state does our component want to receive on $scope?
21
21
mapStateToScope ( state ) {
22
22
return {
23
- counter : state . counter
23
+ value : state . counter
24
24
} ;
25
25
}
26
26
}
You can’t perform that action at this time.
0 commit comments