API reference for Angular CDK coercion
Import symbols from @angular/cdk/coercion
Functions
coerceBooleanProperty | |
---|---|
Coerces a data-bound value (typically a string) to a boolean. |
|
Parameters | |
value any
|
|
Returns | |
boolean
|
|
coerceNumberProperty | |
---|---|
Parameters | |
value any
|
|
fallbackValue number = 0
|
|
coerceArray | |
---|---|
Parameters | |
value T | T[]
|
|
Returns | |
T[]
|
|
coerceCssPixelValue | |
---|---|
Coerces a value to a CSS pixel value. |
|
Parameters | |
value any
|
|
Returns | |
string
|
|
coerceElement | |
---|---|
Coerces an ElementRef or an Element into an element. Useful for APIs that can accept either a ref or the native element itself. |
|
Parameters | |
elementOrRef T | ElementRef<T>
|
|
Returns | |
T
|
|
coerceStringArray | |
---|---|
Coerces a value to an array of trimmed non-empty strings.
Any input that is not an array,
Useful for defining CSS classes or table columns. |
|
Parameters | |
value any
|
the value to coerce into an array of strings |
separator string | RegExp = /\s+/
|
split-separator if value isn't an array |
Returns | |
string[]
|
|