ng-zorro-antd-yj
Version:
An enterprise-class UI components based on Ant Design and Angular
101 lines • 9.27 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { Overlay } from '@angular/cdk/overlay';
import { ApplicationRef, ComponentFactoryResolver, Injectable, Injector } from '@angular/core';
import { NzMessageBaseService } from '../message/nz-message.service';
import { NzNotificationContainerComponent } from './nz-notification-container.component';
import * as i0 from "@angular/core";
import * as i1 from "./public-api";
import * as i2 from "@angular/cdk/overlay";
export class NzNotificationService extends NzMessageBaseService {
/**
* @param {?} overlay
* @param {?} injector
* @param {?} cfr
* @param {?} appRef
*/
constructor(overlay, injector, cfr, appRef) {
super(overlay, NzNotificationContainerComponent, injector, cfr, appRef, 'notification-');
}
// Shortcut methods
/**
* @param {?} title
* @param {?} content
* @param {?=} options
* @return {?}
*/
success(title, content, options) {
return (/** @type {?} */ (this.createMessage({ type: 'success', title, content }, options)));
}
/**
* @param {?} title
* @param {?} content
* @param {?=} options
* @return {?}
*/
error(title, content, options) {
return (/** @type {?} */ (this.createMessage({ type: 'error', title, content }, options)));
}
/**
* @param {?} title
* @param {?} content
* @param {?=} options
* @return {?}
*/
info(title, content, options) {
return (/** @type {?} */ (this.createMessage({ type: 'info', title, content }, options)));
}
/**
* @param {?} title
* @param {?} content
* @param {?=} options
* @return {?}
*/
warning(title, content, options) {
return (/** @type {?} */ (this.createMessage({ type: 'warning', title, content }, options)));
}
/**
* @param {?} title
* @param {?} content
* @param {?=} options
* @return {?}
*/
blank(title, content, options) {
return (/** @type {?} */ (this.createMessage({ type: 'blank', title, content }, options)));
}
/**
* @param {?} type
* @param {?} title
* @param {?} content
* @param {?=} options
* @return {?}
*/
create(type, title, content, options) {
return (/** @type {?} */ (this.createMessage({ type, title, content }, options)));
}
// For content with template
/**
* @param {?} template
* @param {?=} options
* @return {?}
*/
template(template, options) {
return (/** @type {?} */ (this.createMessage({ template }, options)));
}
}
NzNotificationService.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
NzNotificationService.ctorParameters = () => [
{ type: Overlay },
{ type: Injector },
{ type: ComponentFactoryResolver },
{ type: ApplicationRef }
];
/** @nocollapse */ NzNotificationService.ngInjectableDef = i0.defineInjectable({ factory: function NzNotificationService_Factory() { return new i1.NzNotificationService(i0.inject(i2.Overlay), i0.inject(i0.INJECTOR), i0.inject(i0.ComponentFactoryResolver), i0.inject(i0.ApplicationRef)); }, token: i1.NzNotificationService, providedIn: "root" });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotbm90aWZpY2F0aW9uLnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy16b3Jyby1hbnRkLXlqLyIsInNvdXJjZXMiOlsibm90aWZpY2F0aW9uL256LW5vdGlmaWNhdGlvbi5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDL0MsT0FBTyxFQUFFLGNBQWMsRUFBRSx3QkFBd0IsRUFBRSxVQUFVLEVBQUUsUUFBUSxFQUFlLE1BQU0sZUFBZSxDQUFDO0FBRTVHLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBR3JFLE9BQU8sRUFBRSxnQ0FBZ0MsRUFBRSxNQUFNLHVDQUF1QyxDQUFDOzs7O0FBTXpGLE1BQU0sT0FBTyxxQkFBc0IsU0FBUSxvQkFJMUM7Ozs7Ozs7SUFDQyxZQUFZLE9BQWdCLEVBQUUsUUFBa0IsRUFBRSxHQUE2QixFQUFFLE1BQXNCO1FBQ3JHLEtBQUssQ0FBQyxPQUFPLEVBQUUsZ0NBQWdDLEVBQUUsUUFBUSxFQUFFLEdBQUcsRUFBRSxNQUFNLEVBQUUsZUFBZSxDQ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