How to separate data using angular filter
女神的闺蜜爱上我
女神的闺蜜爱上我 2017-06-28 09:27:13
0
1
707
$scope.data=[
                  {"time":"2017/06/23","money":"3000","type":"RMB"},
                  {"time":"2017/06/24","money":"4000","type":"RMB"},
                  {"time":"2017/07/23","money":"3000","type":"RMB"},
                  {"time":"2017/07/23","money":"3000","type":"RMB"},
                  {"time":"2017/07/23","money":"3000","type":"RMB"}
           ];

The requested data is similar to this. The data needs to be displayed based on the time field and the month. How to filter the data in June and July?
For example, when rendering to the page, it should be displayed like this:
June
23 Amount: 3000 Category: RMB
No. 24 Amount: 4000 Category: RMB
July
Amount of 23rd: 3000 Category: RMB
No. 24 Amount: 4000 Category: RMB
25 Amount: 5000 Category: RMB

女神的闺蜜爱上我
女神的闺蜜爱上我

reply all(1)
刘奇
var arr = {};
for(var i=0;i<$scope.data.length;i++){
  var key = $scope.data[i].time.split('/')[1];
    arr[key].push($scope.data[i])
}
return arr;

Purely handwritten, no testing, just writing an idea to further format the object

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!