Try setting custom message with unicode characters, for example: I ♥️ ADF
+
Try setting custom i18n resource key, for example: APP_LAYOUT.NOTIFICATIONS
+
Try toggling the action button. Clicking the action within SnackBar should update the label under the toggle button.
+
All elements support data-automation-id attributes and can be automated.
+
+
+
+
+
+
+
+
+
+
+ With action
+
+
+
+
+ {{ actionOutput }}
+
+
+
diff --git a/demo-shell/src/app/components/notifications/notifications.component.scss b/demo-shell/src/app/components/notifications/notifications.component.scss
new file mode 100644
index 0000000000..eb9da740f3
--- /dev/null
+++ b/demo-shell/src/app/components/notifications/notifications.component.scss
@@ -0,0 +1,3 @@
+.main-content {
+ padding: 10px;
+}
diff --git a/demo-shell/src/app/components/notifications/notifications.component.ts b/demo-shell/src/app/components/notifications/notifications.component.ts
new file mode 100644
index 0000000000..d476fbc652
--- /dev/null
+++ b/demo-shell/src/app/components/notifications/notifications.component.ts
@@ -0,0 +1,47 @@
+/*!
+ * @license
+ * Copyright 2016 Alfresco Software, Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { Component } from '@angular/core';
+import { NotificationService } from '@alfresco/adf-core';
+
+@Component({
+ templateUrl: './notifications.component.html',
+ styleUrls: ['./notifications.component.scss']
+})
+export class NotificationsComponent {
+
+ message = 'I ♥️ ADF';
+ withAction = false;
+ actionOutput = '';
+
+ constructor(private notificationService: NotificationService) {}
+
+ send() {
+ this.actionOutput = '';
+
+ if (this.message) {
+ if (this.withAction) {
+ this.notificationService
+ .openSnackMessageAction(this.message, 'Some action')
+ .onAction()
+ .subscribe(() => this.actionOutput = 'Action clicked');
+ } else {
+ this.notificationService.openSnackMessage(this.message);
+ }
+ }
+ }
+}