一,ng-repeat/filter/orderby使用
数据结构:
-
{
-
"result":true,
-
"ItemWeekIndex":"第二周",
-
"Content":[
-
{
-
"weekIndex":1,
-
"courseInfo":"11教501高等数学",
-
"periodTimesIndex":1
-
},
-
{
-
"weekIndex":1,
-
"courseInfo":"11教232大学英语(一)",
-
"periodTimesIndex":2
-
},
-
{
-
"weekIndex":1,
-
"courseInfo":"11教232食品安全学",
-
"periodTimesIndex":4
-
},
-
{
-
"weekIndex":2,
-
"courseInfo":"11教232乳制品工艺学",
-
"periodTimesIndex":1
-
},
-
{
-
"weekIndex":2,
-
"courseInfo":"11教232大学英语(二)",
-
"periodTimesIndex":2
-
},
-
{
-
"weekIndex":2,
-
"courseInfo":"11教232计算机基础(一)",
-
"periodTimesIndex":4
-
},
-
{
-
"weekIndex":3,
-
"courseInfo":"11教234人体解剖学",
-
"periodTimesIndex":2
-
},
-
{
-
"weekIndex":3,
-
"courseInfo":"11教234植物资源学",
-
"periodTimesIndex":3
-
},
-
{
-
"weekIndex":3,
-
"courseInfo":"11教234花卉栽培技术",
-
"periodTimesIndex":4
-
},
-
{
-
"weekIndex":4,
-
"courseInfo":"11教234植物衰老生物学",
-
"periodTimesIndex":2
-
},
-
{
-
"weekIndex":5,
-
"courseInfo":"11教234文献检索",
-
"periodTimesIndex":3
-
}
-
]
-
}
其中 ,content内放到是本周课表:weekIndex是周几,periodTimesIndex是第几节课,现在筛选本周每天第一节课,并按照顺序weekIndex排列:
-
<div class="col" ng-repeat="FirstLesson in weekLesson.Content | filter:{periodTimesIndex:1}:false | orderBy:weekIndex">{{FirstLesson.courseInfo}}</div>