@anglr/notifications
Version:
Angular module for displaying notifications
38 lines • 2.01 kB
JavaScript
import { Directive, Input } from '@angular/core';
import { nameof } from '@jscrpt/common';
import { NotificationsComponent } from '../../components';
import * as i0 from "@angular/core";
import * as i1 from "../../components";
/**
* Directive used for providing message options directly to notifications
*/
export class MessageOptionsNotificationsDirective {
//######################### constructor #########################
constructor(_notifications) {
this._notifications = _notifications;
}
//######################### public methods - implementation of OnChanges #########################
/**
* Called when input value changes
*/
ngOnChanges(changes) {
if (nameof('messageOptions') in changes && this.messageOptions) {
this._notifications.options =
{
messageOptions: this.messageOptions,
};
}
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: MessageOptionsNotificationsDirective, deps: [{ token: i1.NotificationsComponent }], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0", type: MessageOptionsNotificationsDirective, isStandalone: true, selector: "notifications[messageOptions]", inputs: { messageOptions: "messageOptions" }, usesOnChanges: true, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: MessageOptionsNotificationsDirective, decorators: [{
type: Directive,
args: [{
selector: 'notifications[messageOptions]',
}]
}], ctorParameters: () => [{ type: i1.NotificationsComponent }], propDecorators: { messageOptions: [{
type: Input,
args: [{ required: true }]
}] } });
//# sourceMappingURL=messageOptionsNotifications.directive.js.map