I tried modifying the ng-checked example so that clicking on one of the checkboxes would automatically update the other.
Clicking A, then B, then A again, is not doing what I’m expecting.
What part of the documentation should I look at to understand what’s happening ?
Why don’t you connect both checkboxes to the same model ?
http://jsfiddle.net/ev62U/133/
==================================================================================
To explain your fiddle:
ng-checkeddoes not update the model, it only updates the view (checkbox), once the expression changes.Click A: the
masteris changed totrue, the B checkbox is watching itsng-checkedvalue and therefore updates the view to be checked as well.Click B: the
master2is changed tofalse, the A checkbox is watching itsng-checkedvalue and therefore updates the view to be unchecked as well.Click A: the
masteris set totrueand that’s not really a change as the value already wastrue, so it does not trigger update of B.