Angular checkbox and ng-click

angularjs

Solution

The order of execution of `ng-click` and `ng-model` is ambiguous since they do not define clear priorities. Instead you should use `ng-change` or a `$watch` on the `$scope` to ensure that you obtain the correct values of the model variable.

In your case, this should work:

<input type="checkbox" ng-model="vm.myChkModel" ng-change="vm.myClick(vm.myChkModel)">

Problem

Angular 1.2: ``` <input type="checkbox" ng-model="vm.myChkModel" ng-click="vm.myClick(vm.myChkModel)"> ``` I don't have the right state in my `myClick` function? I want the state, after the click.

Original source