I know I can display a scope variable value by doing:
<div> This is my var value: {{myVar}} </div>
Suppose I have this function
$scope.displayVal = function(){
return myVar+5;
};
Is there a way to call it in a similar way?
<div>{{displayVal()}}</div>
or
<div ng-bind="displayVal()"></div>
If you use Controller as syntax
<div ng-controller="YourController as vm">
<div>{{vm.displayVal()}}</div>
</div>
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