Add more text after using a filter in ng-bind in angularjs

Instead of interpolating(using {{}}) something in the ng-bind directive you can simply enclose the filtered value with a parenthesis and append your text.

<h1 ng-bind="(input | filter) + ' more stuff'"></h1>

furthermore, if the text you want to add is not in any way dynamic then I suggest you append another element to bind the filtered value and then add the text after that element.

e.g.

<h1><span ng-bind="(input | filter)"></span> more stuff</h1>

This saves you one concatenation process.

Example here

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)