Angularjs 角度排序嵌套表

Angularjs 角度排序嵌套表,angularjs,Angularjs,我正在使用嵌套表 示例数据: $scope.building = [ { "id": 1, "name": "first", "ownBlock": [ { "id": 1, "name": "Block 1" }, { "id": 2, "name": "Block 2"

我正在使用嵌套表 示例数据:

$scope.building =
    [
      {
        "id": 1,
        "name": "first",
        "ownBlock": [
          {
            "id": 1,
            "name": "Block 1"
          },
          {
            "id": 2,
            "name": "Block 2"
          }
        ]
      },
      {
        "id": 2,
        "name": "second",
        "ownBlock": [
          {
            "id": 3,
            "name": "Block 1"
          },
          {
            "id": 4,
            "name": "Block 2"
          }
        ]
      }
    ]
当我对id为2的ownBlock进行排序时,它也会对id为1的子数据进行排序

<tr ng-repeat="block in data.ownBlock| orderBy : sortColumn.Field : sortColumn.Order">.... </tr>
。。。。

我知道原因,但我没有解决办法。如果你不想让孩子被分类,那么试试这个

$scope.building = $filter('orderBy')($scope.building,'id');

如果你不想让孩子被分类,试试这个

$scope.building = $filter('orderBy')($scope.building,'id');

您希望数据中的实际排序顺序是什么?您希望子数据不被排序吗?谢谢您的回答,我想对子数据进行排序bro。但我的问题是,当我对具有父Id 2名称“second”的子数据进行排序时,Id 1名称的子数据也会被排序,我不想这样,我只想对Id 2的子数据进行排序。您希望数据中的实际排序顺序是什么?您希望子数据不被排序吗?谢谢您的回答,我想对子数据进行排序bro。但我的问题是,当我对具有父Id 2名称“second”的子数据进行排序时,Id 1名称“second”的子数据也会被排序,我不希望这样,我只希望对Id 2的子数据进行排序