My HAML file:
%pipes-autocomplete{:model =>"filter.value",:option => "validate_option(filter)" ? "dependant(filter)" : "filter.option"}
My Coffee Script:
$scope.validate_option =(filter)->
console.log "called validate_option"
if filter.hasOwnProperty('option') && filter.option.indexOf('dependant') > -1
return true
else
return false
$scope.dependant =(cal)->
return "choosed"
In the ternary operator I'm trying to call the validate_option function defined in my angular controller.But the function is not getting called.Can someone help me with this problem.
"validate_option(filter) ? dependant(filter) : filter.option"(all in one string), so that you defer the execution of the ternary operator to when the string is evaluated.