ng-bind equivalent in Angular
Of course {{ getVal() }}
will work as JB Nizet suggests when you want the returned value of your function to appear somewhere inline in the body of some HTML string. However, what you're actually after is...
Angular 1 Style:
<div ng-bind="getVal()"></div>
becomes...
Angular 2+ ng-bind equivalent:
<div [textContent]="getVal()"></div>
Angular 2+ ng-bind-html equivalent:
<div [innerHtml]="getVal()"></div>