mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2463] Moved core components to subfolder (#3062)
This commit is contained in:
committed by
Eugenio Romano
parent
f3459e1221
commit
333e8ee89c
58
docs/core/notification.service.md
Normal file
58
docs/core/notification.service.md
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
---
|
||||
# Notification Service
|
||||
|
||||
Shows a notification message with optional feedback.
|
||||
|
||||

|
||||
|
||||
## Methods
|
||||
|
||||
- `openSnackMessage(message: string, millisecondsDuration?: number): MatSnackBarRef<any>`
|
||||
Opens a snackbar notification to show a message.
|
||||
- `message` - The message to show
|
||||
- `millisecondsDuration` - (Optional) Time before notification disappears after being shown
|
||||
- `openSnackMessageAction(message: string, action: string, millisecondsDuration?: number): MatSnackBarRef<any>`
|
||||
Opens a snackbar notification with a message and a response button.
|
||||
- `message` - The message to show
|
||||
- `action` - Caption for the response button
|
||||
- `millisecondsDuration` - (Optional) Time before the notification disappears (unless the button is clicked)
|
||||
|
||||
## Details
|
||||
|
||||
The Notification Service is implemented on top of the Angular Material Design snackbar.
|
||||
Use this service to show a notification message, and optionally get feedback from it.
|
||||
|
||||
```ts
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
|
||||
export class MyComponent implements OnInit {
|
||||
|
||||
constructor(private notificationService: NotificationService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.notificationService.openSnackMessage('test', 200000).afterDismissed().subscribe(() => {
|
||||
console.log('The snack-bar was dismissed');
|
||||
});
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```ts
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
|
||||
export class MyComponent implements OnInit {
|
||||
|
||||
constructor(private notificationService: NotificationService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.notificationService.openSnackMessageAction('Do you want to report this issue?', 'send', 200000).afterDismissed().subscribe(() => {
|
||||
console.log('The snack-bar was dismissed');
|
||||
});
|
||||
}
|
||||
}
|
||||
```
|
Reference in New Issue
Block a user