I have an HTML page using AngularJS.
This is basically a listing which can be filtered by clicking on some checkboxes.
I want to use jQuery 'garlic' plugin to memorize checkboxes states.
The plugin is working well, except that AngularJS "does not see" the checkbox states: the listing is not filtered according to checkboxes states. Even without using 'garlic' I have the same problem, I if do something like this :
$(document).ready(function() {
$('#my-checkbox-tracked-by-angular).attr('checked',true_or_false).change();
});
The checkbox itself is visually updated but AngularJS is not triggered.
The only thing that worked to trigger AngularJS is to use click event :
$(document).ready(function() {
$('#my-checkbox-tracked-by-angular).trigger("click");
});
AngularJS is updating the listing, but the click event is also switching the checkbox to the opposite state, and I do not want that.
Is there a way to tell Angular to refresh when a angular-tracked checkbox is updated outside angular ?
Note: I also tried :
$scope.$apply();
But $scope is undefined despite my code is after angular loading. I have AngularJS V1.2.1. How can I get access to $scope ?