This file contains HTML code
<ul class="list">
<li id="numword" data-score="{{item.score}}" class="" ng-repeat="item in words track by $index">
{{item.word}} {{item.score}}
</li>
</ul>
Here is the visual representation of the HTML code:
<li>nice 0.4</li>
<li>sad -0.2</li>
<li>modest 0</li>
The following JavaScript code in Angular retrieves data from 'select.php':
$http.get('select.php') .success(function(data){ $scope.words = data; })
There is a database containing words and corresponding scores, each word having its own numeric score.
The main question here is: data-score="{{item.score}}"
provides values such as 0.4, -0.2, -0.1, 0...
To assign classes to li based on whether the value is greater than 0, equal to 0, or less than 0, how can this be achieved?