Angular UI Components Documentation
The Angular Notification displays an unobtrusive notification to the user. This guide adds the Angular Notification (jqxNotification) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-ngjqwidgets-ng/jqxnotification 
In an Angular project (to start one, see Getting started with Angular), add the package with the Angular CLI. It asks for a theme and adds the styles to angular.json:
ng add jqwidgets-ng
Components are standalone: add jqxNotificationModule to the imports of the component that uses it.
import { Component } from '@angular/core';
import { jqxNotificationModule } from 'jqwidgets-ng/jqxnotification';
@Component({
selector: 'app-root',
imports: [jqxNotificationModule],
templateUrl: './app.html'
})
export class App {}
The source of the live Default Functionality demo.
<!--Notifications-->
<jqxNotification #msgNotification
[width]="250" [position]="'top-right'" [opacity]="0.9" [autoOpen]="false"
[autoClose]="true" [animationOpenDelay]="800" [autoCloseDelay]="3000" [template]="'info'">
<div>
Welcome to our website.
</div>
</jqxNotification>
<jqxNotification #timeNotification
[width]="250" [position]="'top-right'" [opacity]="0.9" [autoOpen]="false"
[autoClose]="true" [animationOpenDelay]="800" [autoCloseDelay]="3000" [template]="'time'">
<div>Current time: <span id="currentTime" style="font-weight: bold;"></span>.</div>
</jqxNotification>
<!--Layout-->
<jqxButton [width]="230" [height]="30" (onClick)="onClickOpenMessageNotification()">
Open a message notification
</jqxButton>
<br /><br />
<jqxButton [width]="230" [height]="30" (onClick)="onClickOpenTimeNotification()">
Open a current time notification
</jqxButton>
import { Component, viewChild } from '@angular/core';
import { jqxNotificationComponent } from 'jqwidgets-ng/jqxnotification';
import { CommonModule } from '@angular/common';
import { jqxNotificationModule } from 'jqwidgets-ng/jqxnotification';
import { jqxButtonModule } from 'jqwidgets-ng/jqxbuttons';
@Component({
imports: [CommonModule, jqxNotificationModule, jqxButtonModule],
selector: 'app-root',
templateUrl: './app.html'
})
export class App {
readonly msgNotification = viewChild.required<jqxNotificationComponent>('msgNotification');
readonly timeNotification = viewChild.required<jqxNotificationComponent>('timeNotification');
onClickOpenMessageNotification(): void {
this.msgNotification().open();
}
onClickOpenTimeNotification(): void {
let date = new Date();
let minutes = date.getMinutes();
let minutesString: String = '';
if (minutes < 10) {
minutesString = '0' + minutes;
} else {
minutesString = '' + minutes;
}
let seconds = date.getSeconds();
let secondsString: String = '';
if (seconds < 10) {
secondsString = '0' + seconds;
} else {
secondsString = '' + seconds;
}
let timeSpan = document.getElementById('currentTime');
timeSpan!.innerText = date.getHours() + ':' + minutesString + ':' + secondsString;
this.timeNotification().open();
}
}
Options are inputs, bound with [name]="value".
Events are outputs named on plus the event name with a capital first letter. For example, click: This event is triggered when the notification is clicked.
<jqxNotification (onClick)="onClick($event)"></jqxNotification>
onClick(event: any): void {
console.log(event.args);
}
Get the component with a signal query and call its methods. For example, open: Opens the widget.
<jqxNotification #myNotification></jqxNotification>
import { Component, viewChild } from '@angular/core';
import { jqxNotificationModule, jqxNotificationComponent } from 'jqwidgets-ng/jqxnotification';
@Component({
selector: 'app-root',
imports: [jqxNotificationModule],
templateUrl: './app.html'
})
export class App {
readonly myNotification = viewChild.required<jqxNotificationComponent>('myNotification');
run(): void {
this.myNotification().open();
}
}