AngularJS adds text to ng-bind with filter
I have this code (output = 1,000):
<span ng-bind"item.num | number : 0"></span> But I want something like 1000 km. Any way to do this without creating a new interval.
Something like this does not work:
<span ng-bind"item.num + ' km' | number : 0"></span> <span ng-bind="(input | filter) + 'km'"></span> As a more general solution, specify a custom JSFiddle filter:
.filter('formatNumber', function () { return function (input) { return input + 'km'; } }); and
<span ng-bind="item.num | formatNumber"></span> You can do this using parentheses.
<span ng-bind"(item.num | number : 0) + 'km' "></span> If the device is always km and not dynamic, you can simply put it in plain text.
<div><p><span ng-bind"item.num | number : 0"></span>km</p></div>