mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
* #537 snackbar notification system * #537 add test dependencies * #537 add export material module * #537 fix demo project
This commit is contained in:
committed by
Maurizio Vitale
parent
d8c433c055
commit
1c21875607
@@ -57,6 +57,7 @@ npm install --save ng2-alfresco-core
|
||||
### Services
|
||||
|
||||
- **LogService**, log service implementation
|
||||
- **NotificationService**, Notification service implementation
|
||||
- **AlfrescoApiService**, provides access to Alfresco JS API instance
|
||||
- **AlfrescoAuthenticationService**, main authentication APIs
|
||||
- **AlfrescoTranslationService**, various i18n-related APIs
|
||||
@@ -95,6 +96,43 @@ let apiService: any = this.authService.getAlfrescoApi();
|
||||
apiService.nodes.addNode('-root-', body, {});
|
||||
```
|
||||
|
||||
#### Notification Service
|
||||
|
||||
The Notification Service is implemented on top of the Angular 2 Material Design snackbar.
|
||||
Use this service to show a notification message, and optionaly get feedback from it.
|
||||
|
||||
```ts
|
||||
import { NotificationService } from 'ng2-alfresco-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 'ng2-alfresco-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');
|
||||
});
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Context Menu directive
|
||||
|
||||
_See **Demo Shell** or **DocumentList** implementation for more details and use cases._
|
||||
|
Reference in New Issue
Block a user