QueryService
Description
Twigkit service for queries
Methods
clearQueries()
Will remove all the queries from the factory.
Example
QueryService.clearQueries();
convertHttpParamsToQuery(httpParams)
Converts http params to query value..
Parameters
Param Type Details httpParams object The httpParams of the query.
Example
QueryService.convertHttpParamsToQuery(value);
convertHttpParamsToUrl(httpParams)
Converts http params into a URL.
Parameters
Param Type Details httpParams object A query object as http params
Example
QueryService.convertHttpParamsToUrl(query, true);
convertQueryToHttpParams(query, excludeHiddenFilters)
convertQueryToUrl(query, includeHiddenFilters)
convertSortObjectToParam()
Will convert sort object into an parameter.
Example
QueryService.convertSortObjectToParam(obj);
convertSortParamToObject()
Will convert sort parameter into an object.
Example
QueryService.convertSortParamToObject(param);
getQuery(name)
getQueryAsHttpParams(name, excludeHiddenFilters)
Gets the value of the query from the factory. If no query is found, the factory will return null.
Parameters
Param Type Details name string Name of the query to retrieve.
excludeHiddenFilters (optional)boolean Whether to include hidden filters in the params.
Returns
object Returns the query object, if no query object exists it will return null.
Example
QueryService.getQueryAsHttpParams(name);
queryContainsFilterForField(query, fieldName, filter)
removeFiltersForField(query, fieldName)
setQuery(name, value)
Events
query_name_updated
When the query is set or changed Lightning will broadcast this message where name is the name of your query
query_name_updated
Type:
broadcastTarget:
root scope