mgcrea / angular-strap

AngularJS 1.2+ native directives for Bootstrap 3.
mgcrea.github.io/angular-strap
MIT License
5.73k stars 1.38k forks source link

fix for bsCheckbox and bsRadio: use $viewValue instead of $modelValue for setting isActive state #2165

Closed elkami12 closed 8 years ago

elkami12 commented 8 years ago

use ngModelController $viewValue and not $modelValue because the isActive state (and so active class of buttons) should be synchronized with viewValue.

For example, if a ngModelOptions is used with debouncing, $modelValue still equals the previous value on $render execution

That's a fix for #2164. Here is a fiddle using patch : https://jsfiddle.net/elkami/pkj3x9xr/

Thanks for review

mgcrea commented 8 years ago

Thanks for the PR!