FIND YOUR NEXT FEW LINES

Results for “strict”

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

268 snippets foundClear filters
TypeScriptNumbers & numeric validation

Display a number with a fixed decimal width

TypeScript: toFixed returns a formatted string rather than a numeric value.

TypeScript✓ Tested
AngularReactive forms

Display a specific reactive validation error

Display a specific reactive validation error with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularAccessibility & reusable patterns

Display untrusted-looking text without HTML execution

Display untrusted-looking text without HTML execution with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
TypeScriptObject behavior & collections

Distinguish an own property from an inherited one

TypeScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.

TypeScript✓ Tested
TypeScriptGetting Started

Divide using a fractional number

TypeScript: Use a floating-point operand to preserve the fractional part of a division.

TypeScript✓ Tested
TypeScriptNumbers & numeric validation

Drop the fractional part toward zero

TypeScript: Math.trunc differs from floor for negative inputs.

TypeScript✓ Tested
AngularComponents & communication

Emit a typed object from a child

Emit a typed object from a child with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularTemplate-driven forms

Enable saving only after a field changes

Enable saving only after a field changes with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
TypeScriptGetting Started

Explain a calculation with a comment

TypeScript: Keep the code executable while documenting why a fixed input is used.

TypeScript✓ Tested
AngularAccessibility & reusable patterns

Expose a disclosure’s expanded state

Expose a disclosure’s expanded state with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularSignals & state

Expose a read-only signal view

Expose a read-only signal view with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularTemplate-driven forms

Expose a required field’s validity

Expose a required field’s validity with a standalone Angular component and explicit browser behavior.

Angular✓ Tested