Reputation: 71
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
Upvotes: 0
Views: 57
Reputation: 1119
As you didn't give the type parameter any value. So I just pass it 1
Try this:
{{getName(1)}}Upvotes: -1
Reputation: 3644
Remove the second pair of curly braces. {{getName(type)}}
is sufficient.
Upvotes: 4