A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.
Contains calculated styles for the component's height and width.
SubAspectComponent is an Angular component that displays a sub-aspect of a media element with customizable dimensions and background color. The component adapts its size and visibility based on the provided properties and listens for window resize and orientation change events.
Selector
app-sub-aspect-component
Standalone
true
Imports
CommonModule
Example
Input
backgroundColor - The background color of the component. Default is 'transparent'.
Input
showControls - Determines if controls are shown within the component. Default is true.
Input
containerWidthFraction - Fraction of the window width for the component width. Default is 1.
Input
containerHeightFraction - Fraction of the window height for the component height. Default is 1.
Input
defaultFractionSub - The default fraction for the sub-aspect height. Default is 0.0.
Method
ngOnInit - Initializes the component and adds event listeners for responsive adjustments.
Method
ngOnChanges - Updates the aspect styles when any of the input properties change.
Method
ngOnDestroy - Removes event listeners when the component is destroyed.
Method
updateAspectStyles - Calculates and applies updated styles based on the window size and input properties.