File

src/notification/notification-display.service.ts

Index

Methods

Constructor

constructor(applicationRef: ApplicationRef)
Parameters :
Name Type Optional Description
applicationRef ApplicationRef

Methods

close
close(notificationRef: any)

Programatically closes notification based on notificationRef. *

Parameters :
Name Type Optional Description
notificationRef any
Returns : void
import {
	Injectable,
	ApplicationRef
} from "@angular/core";

@Injectable()
export class NotificationDisplayService {
	constructor(protected applicationRef: ApplicationRef) {}

	/**
	 * Programatically closes notification based on `notificationRef`.	 *
	 */
	close(notificationRef: any) {
		setTimeout(() => {
			this.applicationRef.detachView(notificationRef.hostView);
			notificationRef.destroy();
		}, 200);
	}
}

results matching ""

    No results matching ""