libs/upp-wdgt/src/directives/upp-dataid.ts
A directive to normalize a given text and bind it to the data-id attribute of the host element.
This directive accepts a string as input, normalizes it using a utility function, and dynamically
updates the data-id attribute of the element it's applied to.
<div uppDataid="My Custom Text"></div>
<!-- Result: <div data-id="my-custom-text"></div> -->
OnChanges
| Selector | [uppDataid] |
Properties |
Methods |
Inputs |
HostBindings |
constructor()
|
| uppDataid |
Type : string | null
|
Default value : null
|
|
Input property that accepts the text to be normalized. |
| attr.data-id |
Type : string | null
|
Default value : null
|
|
HostBinding that dynamically updates the |
| ngOnChanges | ||||||||
ngOnChanges(changes: SimpleChanges)
|
||||||||
|
Handles changes to the input property and updates the
Parameters :
Returns :
void
|
| _normalized |
Type : string | null
|
Default value : null
|
Decorators :
@HostBinding('attr.data-id')
|
|
HostBinding that dynamically updates the |