I've been trying to create a search box to list values but customGET somehow doesn't allow me to have a second parameter. Any solutions? Thank you.
customGETLIST didn't help.
$scope.load_promo_codes = function(){
if($scope.searchCanceller !== null)
$scope.searchCanceller.resolve();
$scope.searchCanceller = $q.defer();
var searchQuery = ('?code=' + $scope.registrationCodesQuery) || '';
Restangular.one('promo_codes',$("#eid").val()).withHttpConfig({timeout: $scope.searchCanceller.promise})
.customGET('get_promo_codes', searchQuery).then(function(response){
$scope.promoCodes = response;
$scope.searchCanceller = null;
$scope.isSearching = false;
if($scope.editId){
var filtered = $scope.promoCodes.filter(function(code){ return code.id == $scope.editId; })[0];
if(filtered) $scope.edit_promo_code(filtered);
}
if(!$rootScope.registrationTypes) $scope.$on('onRegTypesLoaded', function(){ $scope.pageLoaded = true; });
else $scope.pageLoaded = true;
}, function(response){
reload = $scope.$parent.check_error_status(response);
if (reload){
$timeout($scope.load_promo_codes, $scope.$parent.retryMeta['base'] * 2 * 1000);
}
});
};