JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="myApp">
<table ng-controller="myController">
<tr ng-repeat="a in all">
<td>{{a.value}}</td>
</tr>
</table>
</div>
JavaScript
var app = angular.module("myApp", []);
app.controller("myController", ["$scope", function($scope){
$scope.all = [];
var diceRoll = function() {
return Math.floor((Math.random()*(6 - 1))+1);
}
for (i = 0; i < 7; i++) {
var val = diceRoll();
$scope.all.push({"value":val});
}
function sortResults(prop, asc) {
$scope.all = $scope.all.sort(function(a, b) {
if (asc) return (a[prop] > b[prop]);
else return (b[prop] > a[prop]);
});
}
sortResults('value', true);
}]);