JSFiddle - React, Tailwind, and code Playground
by Keammoort
HTML
<div ng-app='myApp' ng-controller="Main">
<li ng-repeat="n in range(5,15)" ng-class="getClass(n)">test {{n}}</li>
</div>
CSS
.red {
color: red;
}
.normal {
color: green;
}
JavaScript
var myApp = angular.module('myApp', []);
function Main($scope){
$scope.range = function(min, max, step){
step = step || 1;
var input = [];
for (var i = min; i <= max; i += step) input.push(i);
return input;
};
$scope.getClass = function(n){
if (n == 5) {
return "red";
} else {
return "normal";
}
};
};