JSFiddle - React, Tailwind, and code Playground

by ncapito

HTML

<div ng-controller='TestCtrl'>
    <ul ng-repeat="i in items|orderBy:'name'|orderBy:'$new'">
        <li>{{i.name}}</li>
    </ul>
    <hr/>
        <ul ng-repeat="i in items|orderBy:sortOrder|orderBy:'$new'">
        <li>{{i.name}}</li>
    </ul>
    
</div>

JavaScript

angular.module('ngTest', []).controller('TestCtrl', function($scope){
    $scope.sortOrder = 'name';
    $scope.items = [
        {name: 'Nick', $new: true},     
        {name: 'Rick'},   
        {name: 'Bob', $new: true}, 
        {name: 'John'},
        {name: 'Jason'},
        {name: 'Trey', $new: true}
    ];
});