Utilities
Detect autofill events on input elements. This can be useful for styling or behavior changes when the browser autofills an input. Floating labels are a common use case for this directive.
Import the Autofill primitives from ng-primitives/autofill
.
import { NgpAutofill } from 'ng-primitives/autofill';
Assemble the autofill directives in your template.
<input ngpAutofill />
The following directives are available to import from the ng-primitives/autofill
package:
[ngpAutofill]
ngpAutofill
The following data attributes are applied to the ngpAutofill
directive:
Attribute | Description |
---|---|
data-autofill |
Applied when the element is autofilled. |
Copyright © 2024 Angular Primitives