Common service utilities for cross-component usage.
- Copyright:
 - Kiwigrid GmbH 2014-2015
 
- Source:
 
Classes
Methods
- <inner> addUrlParameter(uri, param, value) → {string}
 - <inner> doesPropertyExist(obj, prop) → {boolean}
 - <inner> getLabelByLocale(key, labels, currentLocale) → {string|null}
 
- 
    
<inner> addUrlParameter(uri, param, value) → {string}
 - 
    
    
    
Add or modify a parameter in given URL. It maintains the correct order or URL parts.
Parameters:
Name Type Description uristring uri to modify paramstring parameter to modify valuestring value to set parameter to - Source:
 
Returns:
string modified url - 
    
<inner> doesPropertyExist(obj, prop) → {boolean}
 - 
    
    
    This method checks, if a deep property does exist in the given object.
Parameters:
Name Type Description objobject object to check property for propstring property given in dot notation - Source:
 
Returns:
boolean true if property exists - 
    
<inner> getLabelByLocale(key, labels, currentLocale) → {string|null}
 - 
    
    
    
Returns the translation for a given key inside of an object of labels which is grouped by locale keys.
If the given locale is not found inside the labels object the function tries to fall back to the english translation, otherwise the return value is null.The key can be either in short ('en') or long ('en-US') format.
Locales only match from specific > general > fallback
i. e. 'de_AT' > 'de' > 'en'
If a general locale is not defined go straight to fallback locale.Parameters:
Name Type Description keystring translation key to search for labelsobject object with all translation keys grouped by locale keys currentLocaleobject the currently active locale inside of the application - Source:
 
Returns:
string | null the translated label or null if no translation could be found