You should use ng-class as below:
// JS $scope.isPositive = function(value) { return value.indexOf('-') == -1; }
AND
// HTML <style>.green { color: green; } .red { color: red; }</style> <span ng-class="isPositive(i) ? 'green' : 'red'"> {{getValue(i)}} </span>
Working plunker
EDIT
To avoid using the function, do a direct markup check:
<span ng-class="i.indexOf('-') == -1 ? 'green' : 'red'"> {{getValue(i)}} </span>
Updated plunker
source share