I have to create a custom widget in which a property have to be set.
Here is the HTML :
<select ng-model="val" ng-change="ctrl.updateValues()">
<option ng-repeat="val in availableValues" >{{val}}</option>
</select>
And the controller code :
function filterSelect($scope) {
$scope.availableValues = $scope.properties.availableValues;
this.updateValues = function(){
$scope.properties.value = $scope.val;
console.log($scope.properties.valueToEmpty);
$scope.properties.valueToEmpty = "";
console.log($scope.properties.valueToEmpty);
};
}
the idea id to empty the “valueToEmpty” property (defined as Bidirectional bond). The updateValues function is called, but the valueToEmpty never changes.
Is there something wrong with my code?