Interactions
Normalizes the press event across different browsers and devices.
Import the Press primitives from ng-primitives/interactions
.
import { NgpPress } from 'ng-primitives/interactions';
Assemble the press directives in your template.
<div
ngpPress
(ngpPressStart)="onPressStart()"
(ngpPressEnd)="onPressEnd()"
(ngpPressChange)="onPressChange($event)"
></div>
The following directives are available to import from the ng-primitives/interactions
package:
The ngpPress
directive listens for press events on an element. This is particularly useful for supporting press events on touch devices, where press events are not handled consistently.
[ngpPress]
ngpPress
Attribute | Description |
---|---|
data-press |
Applied when the element is being pressed. |
Copyright © 2024 Angular Primitives