I have an object that contains a mixture of numbers and text for values. I would like to apply the numbers filter to the value of an object when that number is (obviously). But, when it's not a number, I would be fine just spitting out a string. As with application | number | number to value formats numbers, but leaves string values empty (after that they are not numbers).
I assume this should be a custom filter (which I still need to do). Is there a way to do this exclusively in HTML when you do ng-repeat ?
<table> <tr ng-repeat="(metric, metricData) in data"> <td>{{metric}}</td> <td>{{metricData | number}}</td> </tr> </table> $scope.data = { name:"this is the name", score:48 outcome:"as expected", attendance:820, total:212.34 };
angularjs filter angularjs-ng-repeat
EnigmaRM Jun 20 '13 at 5:38 on 2013-06-20 05:38
source share