Within my html file, I have the following code snippet:
<select ng-model="selectedCar" ng-change="changedValue(selectedCar)" ng-options="x.license for x in fhu.carList" >
<option value="">Select Car</option>
</select>
I am unsure of how and where to incorporate the changedValue function within my controller. Being new to Angular and JavaScript, a concrete example would be greatly appreciated. The controller is provided below and the dropdown list population is functioning correctly... almost. However, the focus at this moment is on implementing the selection change function.
(function() {
var app = angular.module("fhu", []);
app.controller("FhuController", function(){
this.carList = cars;
});
$(document).ready(function(){
var car = {};
$.getJSON("fillingapi.php?action=get_cars",function(data){
var i=0;
for(i=0;i<data.length;i++){
cars.push( {license: data[i].license, descr: data[i].descr});
}
});
});
var cars=[];
})();