Dealing with Function Overcalls in AngularJS Expressions
I am trying to fetch and display the label associated with the selectedType value in the option tag. However, I am not seeing anything on the view, and multiple calls are being made in the console.
view.jsp
<select ng-if="RCDModel.id!=-1" class="form-control overloadDC"
title="blablabla" disabled>
<option value="{{RCDModel.selectedType}}">
{{exprModelType(RCDModel.selectedType)}}
</option>
</select>
Controller.js
$scope.exprModelType = function(typeModel) {
if (typeModel != undefined) {
$scope.reunionType.forEach(function (type) {
console.log("TYPE: "+type);
if (type.id == typeModel) {
console.log("TYPE ID: "+type.id);
console.log("TYPE ID: "+typeModel);
console.log("Libele: "+type.libelle);
return type.libelle;
}
});
}
return "";
}