Results for “Components & props”
Small, practical examples. Search by task or narrow things down below.
Read a filename stem and extension
C#: Use Path helpers instead of splitting a path on dots or directory separators.
C#✓ Tested
Render signal changes with OnPush
Render signal changes with OnPush with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Require an input value
Require an input value with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Scope a component’s styles
Scope a component’s styles with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Share two-way state through a model input
Share two-way state through a model input with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Calculate a lexical relative path
C++: lexically_relative compares path components without requiring the paths to exist.
C++✓ Tested
Convert a duration to hours and minutes
Python: Use divmod to split nonnegative whole seconds into display components.
Python✓ Tested
Format a bounded duration as hours minutes and seconds
PowerShell: TimeSpan can format duration components with escaped separators.
PowerShell✓ Tested
Inspect a URI through typed properties
PowerShell: The Uri class separates URL components without manual string splitting.
PowerShell✓ Tested
Normalize a path without touching the filesystem
C++: lexically_normal removes redundant dot components using path syntax alone.
C++✓ Tested
Parse an ISO calendar date
Python: Use date.fromisoformat and inspect the calendar components.
Python✓ Tested
Remove a leading directory while extracting
Linux Commands: Use strip-components only after inspecting a trusted archive layout.
Linux Commands✓ Tested