summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/shared/components/notification/notification.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'usecaseui-portal/src/app/shared/components/notification/notification.component.ts')
-rw-r--r--usecaseui-portal/src/app/shared/components/notification/notification.component.ts33
1 files changed, 33 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/shared/components/notification/notification.component.ts b/usecaseui-portal/src/app/shared/components/notification/notification.component.ts
new file mode 100644
index 00000000..031b161d
--- /dev/null
+++ b/usecaseui-portal/src/app/shared/components/notification/notification.component.ts
@@ -0,0 +1,33 @@
+import { Component, OnInit, ViewChild, TemplateRef } from '@angular/core';
+import { NzNotificationService } from 'ng-zorro-antd';
+
+@Component({
+ selector: 'app-notification',
+ templateUrl: './notification.component.html',
+ styleUrls: ['./notification.component.less']
+})
+export class NotificationComponent implements OnInit {
+ @ViewChild('notificationModel')notificationModel: any;
+
+ notificationAttributes: object = null;
+
+ constructor(private notification: NzNotificationService) { }
+
+ ngOnInit() {
+ }
+
+ setNotification({ title, imgPath, action, status, name }):void{
+ this.notificationAttributes = { title, imgPath, action, status, name }
+ }
+ notificationSuccess(title: string, action: string, name: string): void {
+ this.notification.remove()
+ this.setNotification({ title, imgPath: "assets/images/execute-success.png", action, status: 'Success', name })
+ this.notification.template(this.notificationModel);
+ }
+ notificationFailed(title: string, action: string, name: string): void {
+ this.notification.remove()
+ this.setNotification({ title, imgPath: "assets/images/execute-faild.png", action, status: 'Failed', name })
+ this.notification.template(this.notificationModel)
+ }
+
+}