angularJS按键列表排序

时间:2016-01-06 18:10:04

标签: angularjs

如何在升序或降序mainSubjectAllocationList&中实现ORDER BY。 printSubjectAllocationList打印表时的键。

我的代码如下

vm.sectionListWithClass = [

  {
    "classStd": "Prep-2015",
    "classId": "1",
    "section": "B",
    "sectionName": "RED",
    "sectionId": "6",
    "mainSubjectAllocationList": "Hindi, Biology, Geography, English, Chemistry",
    "mainSubjectAllocationId": "28",
    "optionSubjectAllocationList": "Chemistry, P.T, 3rd lang Urdu, Art, 3rd lang Arabic, 3rd lang Chinese, 3rd lang German, Life Skill",
    "optionSubjectAllocationId": "27"
  }
 ]





 <tbody ng-repeat="(key, value) in vm.sectionListWithClass | groupBy: 'classStd'" >
                    <tr ng-repeat="player in value | orderBy: 'section' | orderBy:'mainSubjectAllocationList':true">

1 个答案:

答案 0 :(得分:0)

试试这个(尚未测试,但我非常自信):

<tr ng-repeat="player in value | orderBy: ['section', '-mainSubjectAllocationList']">