JSFiddle - React, Tailwind, and code Playground

by michapixel

HTML

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.11/angular.min.js"></script>
<div ng-app="">
    <div ng-controller="ListCtrl">
        <h4>List:</h4>
        <pre>Sorting predicate = {{predicate}}; reverse = {{reverse}}</pre>
        <ul>
            <li ng-repeat="item in list | orderBy:predicate:reverse">
               # {{$index}} | {{item.name}} | {{item.index}} | {{item.index == $index}}
            </li>
        </ul>
     
    </div>
</div>

JavaScript

var App = angular.module('App',[]);

function ListCtrl($scope){
     $scope.list = [
         {"name" : "test1", index:0},
         {"name" : "test21", index:1},
         {"name" : "test3", index:2},
         {"name" : "test4", index:3},
         {"name" : "test5", index:4},
         {"name" : "test6", index:5},
         {"name" : "test7", index:6},
         {"name" : "test8", index:7},
         {"name" : "test9", index:8},
         {"name" : "test10", index:9}                    
    ];
    $scope.predicate = 'name';
 }