>if ($scope.searchTerm.message) > { > $scope.filteredTransactions = $filter('filter')($scope.invoiceTransactionsObject.transactions, { message: $scope.searchTerm.message, item: $scope.searchTerm.message }); > }>
> $scope.applyFilter = function() > { > $scope.filteredTransactions = $scope.invoiceTransactionsObject.transactions; > if ($scope.searchTerm.message) > { > $scope.filteredTransactions = $filter('filter')($scope.invoiceTransactionsObject.transactions, ({ message: $scope.searchTerm.message } || { item: $scope.searchTerm.message })); > } > > if ($scope.startDate != null || $scope.endDate != null) > { > for (var i = $scope.filteredTransactions.length - 1; 0, i--;) > { > if ($scope.startDate!=null && $scope.filteredTransactions[i].dateTime < $scope.startDate) > { > $scope.filteredTransactions.splice(i,1); // remove that element > continue; > } > if ($scope.endDate!=null && $scope.filteredTransactions[i].dateTime > $scope.endDate) > { > $scope.filteredTransactions.splice(i,1); // remove that element > continue; > } > } > } > $scope.filteredTotal = $scope.getTotal($scope.filteredTransactions, 'extension'); > } >>