Stop AngularJS ng-repeat rendering in alphabetical order

后端 未结 3 736
抹茶落季
抹茶落季 2021-01-12 20:19

In my angular app I\'m trying to display JSON data in a table. The data looks like this:

$scope.data = 
  {
    \"EVENT NAME\":\"Free Event\",
    \"ORDER ID         


        
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-12 20:55

    You can achieve it like this

    Working Demo

    In the scope define a method like as shown

    $scope.notSorted = function(obj){
        if (!obj) {
            return [];
        }
        return Object.keys(obj);
    }
    

    and in html like as shown below

    html

    {{key}}
    {{value}}

    Original Article: ng-repeat with no sort? How?

提交回复
热议问题