AngularJS append text to ng-bind with filter

Christopher picture Christopher · Aug 10, 2015 · Viewed 10.6k times · Source

I have this code (output=1,000):

<span ng-bind"item.num | number : 0"></span>

But i want something like 1,000 km. Any way to do this without create a new span.

Something like this isn't working:

<span ng-bind"item.num + ' km' | number : 0"></span>

Answer

Andr&#233; Tiago picture André Tiago · Aug 10, 2015
<span ng-bind="(input | filter) + 'km'"></span>