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.
A callback method that performs custom clean-up, invoked immediately before a directive, pipe, or service instance is destroyed.
MiniCardAudio component displays an audio card with optional waveform animation and overlay.
Selector
app-mini-card-audio
Standalone
true
Imports
CommonModule
Template: -
Displays:
Styles
Inputs
customStyle(Partialname(string): Name displayed on the card.showWaveform(boolean): Controls visibility of waveform animation.overlayPosition(string): Position for the overlay on the card.barColor(string): Color of waveform bars.textColor(string): Color of the name text.imageSource(string): URL for the background image.roundedImage(boolean): Rounds image corners if true.imageStyle(PartialMiniCardAudio
Implements
OnInit, OnDestroy
Methods
ngOnInit: Initializes the component, starts waveform animation ifshowWaveformis true.ngOnDestroy: Cleans up intervals.animateWaveform: Starts animation of the waveform bars.resetWaveform: Resets waveform to initial state.clearIntervals: Clears all active intervals.getAnimationDuration: Returns duration for animation at a given index.getImageStyle: Combines custom image styles with rounded corners if enabled.getOverlayPosition: Uses utility to determine the overlay's position.Example