rawCtrl.js 471 B

1234567891011121314151617181920
  1. app.controller('rawCtrl', ['$scope', '$http', function ($scope, $http) {
  2. $scope.update = function() {
  3. $http.get('back/list/raw').success(function(data) {
  4. $scope.rawlist = data.list.filter(function(f) {
  5. return (f.date === +f.date) //Check if it's a number
  6. }).map(function(f) {
  7. var item = f;
  8. item.date = item.date*1000;
  9. return item;
  10. }).sort(function(a,b) {
  11. return ( b.date > a.date ? 1 : -1 );
  12. });
  13. });
  14. };
  15. $scope.update();
  16. }]);