How to create complex query parameters in Restangular
I need to create a rather complex query string in Restangular.
http://vdmta.rd.mycompany.net//people?anr=Smith&attrs=givenName,displayName,name,cn
How to do it?
So far my guess is as far as possible: anr = Smith using this:
return Restangular.all('/people').getList({anr:searchTerm});
The last part attrs = x, y, x allows me to control which attributes I want to find in the search, and can change every query I make.
Any advice is appreciated.
Hello
I am
+3
source to share
1 answer
You should be able to just add another query parameter where the value is a comma-separated list of attributes.
var attributes = ['givenName' , 'displayName']; // attributes you require for the request
var attributesAsString = attributes.join();
return Restangular.all('/people').getList({
anr : searchTerm,
attrs: attributesAsString
});
+4
source to share