The snippet library.
Small, practical examples. Search by task or narrow things down below.
Control a native dialog through a reference
Control a native dialog through a reference with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Focus an input through its template reference
Focus an input through its template reference with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Handle Escape to dismiss a panel
Handle Escape to dismiss a panel with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Handle the Enter key specifically
Handle the Enter key specifically with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Prevent a link’s default navigation
Prevent a link’s default navigation with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Read a DOM element through a viewChild signal
Read a DOM element through a viewChild signal with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Read a typed input event
Read a typed input event with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Stop a nested click from reaching its parent
Stop a nested click from reaching its parent with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Validate a field when focus leaves it
Validate a field when focus leaves it with a standalone Angular component and explicit browser behavior.
Angular✓ Tested