I have a list of objects with 2 attributes: label and description. On html I cycle on this list:
<select class="form-control"
ng-options="fid.label for fid in myFidList"
ng-model="fidSelected"
ng-change="setFidDescription()"/>
What I'm trying to do is calling a function (setFidDescription) to get the object I have selected on option tag. So I can change the respective desciption in another div. That's seems not working: ng-model seems not updating.The function:
$scope.setFidDescription = function () {
console.log($scope.fidSelected);
}
This code print an empty object. What am i missing? Another way to go could be get the $index of my choice.
Update: I have found my problem. See here for the explanation:
AngularJS ngModel doesn't work inside a ui-bootstrap tabset
That was my problem.