A callback method that is invoked immediately after the default change detector has checked data-bound properties if at least one has changed, and before the view and content children are checked.
The changed properties.
OptionalalertOptionalcustom
AlertComponent - Toast-style notification component for success and error messages
Component
Description
Displays toast-style alert messages with automatic dismiss timer and manual close option. Supports three levels of customization:
Key Features:
Example
Basic Usage:
Example
Style Customization:
Example
Custom Template Override:
Selector
app-alert-component
Standalone
true
Imports
CommonModule
Input
visible - Whether the alert is currently visible. Default:
falseInput
message - The message text to display in the alert. Default:
''Input
type - Alert type ('success' or 'danger') affecting color scheme. Default:
'success'Input
duration - Auto-dismiss duration in milliseconds. Default:
4000Input
textColor - Color of the message text. Default:
'black'Input
onHide - Callback function invoked when alert is dismissed (auto or manual). Default:
undefinedInput
alertStyle - Custom CSS styles to apply to the alert container. Default:
undefinedInput
customTemplate - Custom TemplateRef to completely replace default alert template. Default:
undefinedMethod
ngOnChanges - Handles input changes and triggers auto-dismiss timer when visible
Method
handlePress - Manually dismisses the alert by invoking onHide callback