new PropertyHelper()
Static helper class for working with object properties.
Used for bindings.
Methods
-
<static> convertPathToArray(property)
-
Convert property path to array
Parameters:
Name Type Description propertystring property path Returns:
path as array- Type
- array.<string>
Example
Path: prop.prop[0][0].prop Result: [prop,prop,[0],[0],prop]
-
<static> getProperty(property, root)
-
Get property value by path
Parameters:
Name Type Description propertyarray.<string> | string property path rootobject | undefined start point for search Returns:
result- Type
- * | null
-
<static> getPropertyField(property, root)
-
Get property by path
Parameters:
Name Type Description propertyarray.<string> | string property path rootobject | undefined start point for search Returns:
result- Type
- object | array
-
<static> hasProperty(property, root)
-
Check if object has property
Parameters:
Name Type Description propertyarray.<string> | string property path rootobject | undefined start point for search Returns:
has / has not- Type
- boolean
-
<static> isPropertyArray(property)
-
Check if property is array
Parameters:
Name Type Description propertystring property Returns:
is / is not- Type
- boolean
Example
Prop: prop[0] returns true Prop: prop returns false
-
<static> setProperty(property, value, root)
-
Set property by path
Parameters:
Name Type Description propertyarray.<string> | string property path value* property value rootobject | undefined start point for search -
<static> walkThroughProperties(elements, root, callback, scope)
-
Deep walk through proeprty and calls callback on each element
Parameters:
Name Type Description elementsarray.<string> property path rootobject root object callbackfunction scopeobject | null