$lightningUrl
Description
Twigkit factory for getting and setting the location (url).
Methods
addFilterObjectToUrl(filter, reloadSearch)
addFilterToLocationCopy(fieldName, actual, display, orFilter, location, exclude, match)
Method to add a filter to the url
Parameters
Param Type Details fieldName string The name of the filter to apply.
actual string The actual value of the filter.
display string The display value of the filter.
orFilter (optional)string If the filter is to be ORed.
location object The location object to use, this should be angular.copy'd before
exclude (optional)boolean If the filter is to be exclude values
match (optional)string 'left_partial' or 'partial' or 'right_partial' or 'exact'
Example
$lightningUrl.addFilterToUrl(addFilterToLocationCopy, actual, display, orFilter, location);
addFilterToUrl(fieldName, actual, display, reloadSearch, orFilter, exclude, match)
Method to add a filter to the url
Parameters
Param Type Details fieldName string The name of the filter to apply.
actual string The actual value of the filter.
display string The display value of the filter.
reloadSearch (optional)boolean Whether to reload search results.
orFilter (optional)string If the filter is to be ORed
exclude (optional)boolean If the filter is to be exclude values
match (optional)string 'left_partial' or 'partial' or 'right_partial' or 'exact'
Example
$lightningUrl.addFilterToUrl(filterName, actual, display, reloadSearch);
addRangeFilterDisplayToUrl(fieldName, from, to, displayFrom, displayTo, reloadSearch, orFilter, fromExcluded, toExcluded, exclude)
Method to add a filter to the url
Parameters
Param Type Details fieldName string The name of the filter to apply.
from string The from value of the filter.
to string The to value of the filter.
displayFrom string The from display value of the filter.
displayTo string The to display value of the filter.
reloadSearch (optional)boolean Whether to reload search results.
orFilter (optional)boolean If the filter is to be ORed
fromExcluded (optional)string whether the from is to be excluded.
toExcluded (optional)string Whether the to is to be excluded.
exclude (optional)boolean Whether the values should be excluded.
Example
$lightningUrl.addRangeFilterDisplayToUrl(fieldName, from, to, display, reloadSearch, orFilter, fromExcluded, toExcluded) ;
addRangeFilterToUrl(fieldName, from, to, displayFrom, displayTo, reloadSearch, orFilter, toLabel, fromExcluded, toExcluded, exclude)
Method to add a filter to the url
Parameters
Param Type Details fieldName string The name of the filter to apply.
from string The from value of the filter.
to string The to value of the filter.
displayFrom string The from display value of the filter.
displayTo string The to display value of the filter.
reloadSearch (optional)boolean Whether to reload search results.
orFilter (optional)boolean If the filter is to be ORed
toLabel (optional)string The label which appears between the from and to values.
fromExcluded (optional)string whether the from is to be excluded.
toExcluded (optional)string Whether the to is to be excluded.
exclude (optional)boolean Whether the values should be excluded.
Example
$lightningUrl.addRangeFilterToUrl(fieldName, from, to, displayFrom, displayTo, reloadSearch, orFilter, toLabel, fromExcluded, toExcluded);
createFilter(fieldName, actual, display, orFilter, exclude, match, type)
Creates a filter for the URL
Parameters
Param Type Details fieldName string The name of the filter to apply.
actual string The actual value of the filter.
display string The display value of the filter.
orFilter (optional)string If the filter is to be ORed (field or value)
exclude (optional)boolean If the filter is to be exclude values
match (optional)string 'left_partial' or 'partial' or 'right_partial' or 'exact'
type (optional)string Explicitly set the type of the filter, 'string' or 'number'. A string filter value will be wrapped in double quotes.
Returns
string Returns a filter that can be added to the URL
createFilterFromObject(filter)
createRangeFilter(fieldName, from, to, displayFrom, displayTo, orFilter, toLabel, fromExcluded, toExcluded, exclude)
Creates a range filter for the URL
Parameters
Param Type Details fieldName string The name of the filter to apply.
from string The from value of the filter.
to string The to value of the filter.
displayFrom string The from display value of the filter.
displayTo string The to display value of the filter.
orFilter (optional)string If the filter is to be ORed (value | field)
toLabel (optional)string The label which appears between the from and to values.
fromExcluded (optional)string whether the from is to be excluded.
toExcluded (optional)string Whether the to is to be excluded.
exclude (optional)boolean Whether the values should be excluded.
Returns
string Returns a filter that can be added to the URL
createRangeFilterDisplay(filterName, from, to, display, orFilter, fromExcluded, toExcluded, exclude)
Creates a range filter for the URL
Parameters
Param Type Details filterName string The name of the filter to apply.
from string The from value of the filter.
to string The to value of the filter.
display string The display value of the filter.
orFilter (optional)string If the filter is to be ORed (value | field)
fromExcluded (optional)string whether the from is to be excluded.
toExcluded (optional)string Whether the to is to be excluded.
exclude (optional)boolean Whether the values should be excluded.
Returns
string Returns a filter that can be added to the URL
getAllUrlParameters()
Method to get a copy of all URL parameters
Returns
object Object literal of all URL parameters
Example
$lightningUrl.getAllUrlParameters();
getFiltersFromUrl(fieldName)
getUrlParameter(parameter, defaultValue)
Method to get a url parameter
Parameters
Param Type Details parameter string The parameter to get from the URL.
defaultValue (optional)string The value to return if parameter returns null.
Returns
var Returns value of parameter from URL or defaultValue.
Example
$lightningUrl.getUrlParameter(parameter, defaultValue);
getUrlParametersAsArray(parameter, defaultValue)
Method to gets an array of url parameters
Parameters
Param Type Details parameter string The parameter to get from the URL.
defaultValue (optional)string The value to return if parameter returns null.
Returns
Array Returns values of the parameter from URL or defaultValue in an array.
Example
$lightningUrl.getUrlParametersAsArray(parameter, defaultValue);
removeFiltersFromUrl(filterName, reloadSearch)
removeFiltersFromUrl(filterName, reloadSearch)
resetAllParameters(reloadSearch)
resetParameters(parameters, reloadSearch)
setUrlParameter(parameter, value, reloadSearch)
setUrlParameters(query, reloadSearch)
urlContainsFilter(filterName, actual, display, orFilter, exclude, match)
Method to set if filter is in the url
Parameters
Param Type Details filterName string The name of the filter to apply.
actual string The actual value of the filter.
display string The display value of the filter.
orFilter (optional)string If the filter is to be ORed on
value
orfield
exclude (optional)boolean If the filter is to be exclude values
match (optional)string 'left_partial' or 'partial' or 'right_partial' or 'exact'
Returns
boolean Whether the URL contains the filter.
urlContainsFilterFromObject(filter)