alfresco-ng2-components/docs/notification.service.md
Andy Stark 1c6866f7d1 [ADF-1549] Added files for Core library (#2345)
* [ADF-1549] Added files for Core library

* [ADF-1549] Updated md files following checks
2017-09-18 16:52:56 +01:00

1.2 KiB

Notification Service

Shows a notification message with optional feedback.

Details

The Notification Service is implemented on top of the Angular 2 Material Design snackbar. Use this service to show a notification message, and optionally get feedback from it.

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');
                });
    }
}
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');
            });
    }
}