File

libs/upp-wdgt/src/directives/upp-dataid.ts

Description

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.

Example :
<div uppDataid="My Custom Text"></div>
<!-- Result: <div data-id="my-custom-text"></div> -->

Implements

OnChanges

Metadata

Index

Properties
Methods
Inputs
HostBindings

Constructor

constructor()

Inputs

uppDataid
Type : string | null
Default value : null

Input property that accepts the text to be normalized.

HostBindings

attr.data-id
Type : string | null
Default value : null

HostBinding that dynamically updates the data-id attribute with the normalized value of the input.

Methods

ngOnChanges
ngOnChanges(changes: SimpleChanges)

Handles changes to the input property and updates the data-id attribute.

Parameters :
Name Type Optional Description
changes SimpleChanges No
  • A map of changes to the input properties of the directive.
Returns : void

Properties

_normalized
Type : string | null
Default value : null
Decorators :
@HostBinding('attr.data-id')

HostBinding that dynamically updates the data-id attribute with the normalized value of the input.

results matching ""

    No results matching ""