FIND YOUR NEXT FEW LINES

Results for “element”

Small, practical examples. Search by task or narrow things down below.

269 snippets foundClear filters
AngularGetting Started

Handle an event emitted by a child

Handle an event emitted by a child with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularServices & dependency injection

Handle an optional dependency

Handle an optional dependency with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularEvents & DOM interaction

Handle Escape to dismiss a panel

Handle Escape to dismiss a panel with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularEvents & DOM interaction

Handle the Enter key specifically

Handle the Enter key specifically with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularLifecycle & observable data

Initialize component data with ngOnInit

Initialize component data with ngOnInit with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularGetting Started

Inject a service into a component

Inject a service into a component with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
PythonNumbers & calculations

Insert a value while preserving sorted order

Python: Use insort on an already sorted list; insertion still shifts later list elements.

Python✓ Tested
CArray transformations

Insert into an array with spare capacity

C: Move the trailing elements before inserting and keep the logical length separate from capacity.

C✓ Tested
AngularPipes & formatting

Inspect structured data with JsonPipe

Inspect structured data with JsonPipe with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
CStructures & function interfaces

Iterate over a fixed array of records

C: Compute the array element count with sizeof at the point where it is still an array.

C✓ Tested
JavaStream transformations

Join transformed stream values

Java: Use Collectors.joining after converting elements to strings.

Java✓ Tested
AngularAccessibility & reusable patterns

Keep a secondary button from submitting a form

Keep a secondary button from submitting a form with a standalone Angular component and explicit browser behavior.

Angular✓ Tested