I usually return true/false from a function and pass that function into a property, but in this case it is not working.
For example:
Passing false into isEnabled works:
$scope.myDropDownConfig = {
allowMultiple: false,
onSelecting: $scope.onSelect,
isEnabled: false;
};
This does not work:
$scope.myDropDownConfig = {
allowMultiple: false,
onSelecting: $scope.onSelect,
isEnabled: function () {
return false;
}
};
Is the expression not being evaluated in time? I thought it would be the same as using a bool directly... no errors, debugger wont catch. Any ideas? Do I have to tell angular to evaluate an expression?
First property is simple property and the second property is a function. So you need to invoke the second with parenthesis ()
$scope.myDropDownConfig.isEnabled$scope.myDropDownConfig.isEnabled()If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With