batch changes desc order

This commit is contained in:
gandhimathi 2018-05-26 13:03:37 +05:30
parent 4ad702d21e
commit fc365157ff

View File

@ -4,7 +4,7 @@
* Simple table with sorting and filtering on AngularJS
*/
app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", function ($scope,$rootScope,toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state) {
app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", "dateListDescService", function ($scope,$rootScope,toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, dateListDescService) {
$scope.myModel = {
"batchCode": "",
"batchName": "",
@ -259,13 +259,18 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl
$scope.emptyData=true;
$scope.loader=true;
$scope.data = response.data.details;
// call service for make list in desc order based on date
angular.forEach($scope.data,function (value,key) {
var parts = value.BatchDate.split("-");
value.givenDateObject=new Date(parts[2], parts[1] - 1, parts[0]);
});
// end service call
$scope.data=dateListDescService.getOrderByList($scope.data);
$scope.university=response.data.universityDetails;
} else {
$scope.emptyData=false;
$scope.loader=true;