Something strange is happening with my code. I have a checkbox in my view that has a directive to display its value when it changes. Surprisingly, it works fine in Firefox, showing the correct values. However, in other browsers like Chrome, it shows the opposite response. For example, if the checkbox is checked, it should show 'true', but it displays 'false'!
This is what's in my view:
<input type="checkbox" id="accept" name="accept" ng-model="accept" d6 />
Here is my directive:
validation.directive('d6', ['$parse', function($parse){
return {
require: 'ngModel',
restrict: 'A',
link: function link(scope, elem, attrs, control) {
elem.on('change', function(){
console.log(control.$modelValue);
});
}
}
}]);