我在范围变量中有一个对象数组,现在我想根据特定对象(日期字段)和显示对该数组进行排序。我已经提到了下面的逻辑
<ion-option-button role="button" data-ng-click="save(data)"></ion-option-button>
控制器:
$scope.save = function(data) {
var action='save';
//service call happens and response is returned
if (response.isSuccessful === true && response.responseCode == "1") {
vm.data = moveElementInArray(vm.data, data, 0);
//perform sorting with respect to a date field after moving to index 0 , vm.data contains the array objects
}
};