My select box is successfully interacting with the Angular list. The 'citta' field in the select box filters the list when its value changes.
ng-model="queryLoc.citta"
First, I initialize the variable
$scope.queryLoc = { citta: ''};
Now, I want to set the queryLoc value by clicking a button inside a Google Maps infoWindow. When the button is clicked, I use this code to call the 'filtraLoc' function:
angular.element(document.getElementById('eventCont')).scope().filtraLoc(citta);
This is what the 'filtraLoc' function does:
$scope.filtraLoc = function(city){
$scope.queryLoc = {citta: city};
};
In my JSON data, there is an attribute called 'citta' as shown below:
{
immagine:'/upload/cms/770_x/Lonato(2).jpg',
linkScheda: '/cms-01.00/articolo.asp?IDcms=77193&s=269',
nome: 'MERCATO CONTADINO A LONATO DEL GARDA',
citta: 'Lonato del Garda',
data: 'OGNI SABATO MATTINA DALLE ORE 8 ALLE 13',
categoria: '',
latitudine: '8',
longitudine: '82',
show: 'false'
}
However, the filter is not working correctly and I am unable to find any errors in the browser console. Any help or tips would be greatly appreciated. Thank you.