I use AngularJS for storing data in JSON and want to filter shown on the page items. Each item includes country code as a property:
[
{
"id": "1",
"code": "us"
},
{
"id": "2",
"code": "ca"
}
]
I want to use Jquery VMap to filter items. When I click to the region, the list of items should be filtered. When I use simple "input" field, the list is filtered. But when I use following code that is executed when I click to the county, nothing happens:
onRegionClick: function(element, code, region)
{
document.getElementById("query").value = code;
function updateQuery($scope) {
$scope.query = code;
$scope.$digest();
}
}
How can I make Angular knows about the change of "query" or is there any better solution? Link to the fiddle: http://jsfiddle.net/47RLz/4/