### File

`src/notification/notification-display.service.ts`

### Index

###### Methods

- close

### Constructor

`constructor(applicationRef: ApplicationRef)`
Defined in src/notification/notification-display.service.ts:7

Parameters :

Name | Type | Optional
applicationRef | `ApplicationRef` | No

### Methods

close
`close(notificationRef: any)`
Defined in src/notification/notification-display.service.ts:13

Programatically closes notification based on `notificationRef`. *

Parameters :

Name | Type | Optional
notificationRef | `any` | No

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) {
    		if (notificationRef.hostView) {
    			setTimeout( () => {
    				this.applicationRef.detachView(notificationRef.hostView);
    				notificationRef.destroy();
    			}, 200);
    		}
    	}
    }

# result-matching ""

# No results matching ""