"converters" schema section
Converters are functions that modify the value of the ViewModel attribute bound to a property of the visual component. Converters provided by Creatio work similarly to Angular filters. Read more: official Angular documentation.
View an example of container usage: Implement the field value conversion on a page.
Creatio provides the following base converters.
crt.ToBoolean
Convert the values of other types to the boolean type.
crt.InvertBooleanValue
Convert the boolean type value to the opposite boolean type value. For example, if the incoming value is "true," the converter returns "false," and vice versa.
crt.ToEmailLink
Convert an email address to a link by adding the mailTo: prefix.
crt.ToObjectProp
Retrieve the value of the specified object property. Returns the value of a given object property, or the default value if the property is missing or empty.
Parameters
Parameter | Type | Required | Description |
|---|---|---|---|
value | object | Yes | The object whose property to retrieve. |
prop | string | Yes | The name of the property to retrieve. |
defaultValue | any | No | The value to return if the property does not exist or the response is "false." |
crt.ToPhoneLink
Convert the phone number to a link by adding the tel: prefix.
crt.IsEqual
Compare the bound ViewModel attribute value to the parameter passed to the converter. Returns "true" if the values are equal, "false" otherwise.
Parameters
Parameter | Type | Required | Description |
|---|---|---|---|
value | any | Yes | The bound |
compareValue | any | Yes | The value to compare the incoming value against. Supports collections. |