Error handling service.
Provides a simple reactive interface for displaying and clearing temporary error and success messages across the application.
Messages are automatically cleared after a short timeout.
Readonly signal exposing the current error message. Components can subscribe to this for reactive updates.
Clears all error and success messages immediately.
Useful for manual resets or before navigation.
Displays an error message to the user.
Automatically clears the message after 3 seconds.
The error message to display.
this.errorService.showError('Invalid credentials'); Copy
this.errorService.showError('Invalid credentials');
Displays a success message to the user.
Automatically clears both success and error messages after 3 seconds.
The success message to display.
this.errorService.showSuccess('Profile updated successfully'); Copy
this.errorService.showSuccess('Profile updated successfully');
Error handling service.
Provides a simple reactive interface for displaying and clearing temporary error and success messages across the application.
Messages are automatically cleared after a short timeout.