diff options
Diffstat (limited to 'src/angular/notifications/notification/notification.component.ts')
-rw-r--r-- | src/angular/notifications/notification/notification.component.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/angular/notifications/notification/notification.component.ts b/src/angular/notifications/notification/notification.component.ts index 476853c..8b89467 100644 --- a/src/angular/notifications/notification/notification.component.ts +++ b/src/angular/notifications/notification/notification.component.ts @@ -1,7 +1,7 @@ import { Component, Input, Output, EventEmitter, OnInit, ViewContainerRef, ViewChild } from "@angular/core"; import { NotificationSettings } from "../utilities/notification.config"; import { CreateDynamicComponentService } from "../../utils/create-dynamic-component.service"; -import template from "./notification.component.html"; +import { template } from "./notification.component.html"; @Component({ selector: 'sdc-notification', @@ -10,31 +10,31 @@ import template from "./notification.component.html"; export class NotificationComponent implements OnInit { - @Input() notificationSetting:NotificationSettings; + @Input() notificationSetting: NotificationSettings; @Output() destroyComponent = new EventEmitter<any>(); - @ViewChild("dynamicContentContainer", {read: ViewContainerRef}) contentContainer:ViewContainerRef; - private fade: boolean = false; + @ViewChild("dynamicContentContainer", { read: ViewContainerRef }) contentContainer: ViewContainerRef; + public fade: boolean = false; constructor(private createDynamicComponentService: CreateDynamicComponentService) { } public ngOnInit() { - if(this.notificationSetting.hasCustomContent){ + if (this.notificationSetting.hasCustomContent) { this.createDynamicComponentService.insertComponentDynamically(this.notificationSetting.innerComponentType, this.notificationSetting.innerComponentOptions, this.contentContainer); } - if(!this.notificationSetting.sticky){ + if (!this.notificationSetting.sticky) { setTimeout(() => this.fadeOut(), this.notificationSetting.duration); } } - private fadeOut = ():void => { + public fadeOut = (): void => { this.fade = true; } - private destroyMe() { + public destroyMe() { /*Only destroy on fade out, not on entry animation */ - if(this.fade){ + if (this.fade) { this.destroyComponent.emit(this.notificationSetting); } } |