How to return result in HTML template from fnuction Angular JS?
HTML:
<div>{{getName({{type}})}}</div>
Angular JS:
$scope.getName = function (type){
return 'Bob';
}
I need to get Bob in DIV element
As you didn't give the type parameter any value. So I just pass it 1
Try this:
{{getName(1)}}type is not definied. Even if it is not defined, angulars interpolations are forgiving, meaning that still Bob would be displayed.