UNPKG

ng-zorro-antd-yj

Version:

An enterprise-class UI components based on Ant Design and Angular

73 lines 5.5 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { Inject, Injectable, Optional, TemplateRef, Type } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; import { NZ_DEFAULT_EMPTY_CONTENT } from './nz-empty-config'; import { getEmptyContentTypeError } from './nz-empty-error'; import * as i0 from "@angular/core"; import * as i1 from "./public-api"; /** * @template T */ var NzEmptyService = /** @class */ (function () { function NzEmptyService(defaultEmptyContent) { this.defaultEmptyContent = defaultEmptyContent; this.userDefaultContent$ = new BehaviorSubject(undefined); if (this.defaultEmptyContent) { this.userDefaultContent$.next(this.defaultEmptyContent); } } /** * @param {?=} content * @return {?} */ NzEmptyService.prototype.setDefaultContent = /** * @param {?=} content * @return {?} */ function (content) { if (typeof content === 'string' || content === undefined || content === null || content instanceof TemplateRef || content instanceof Type) { this.userDefaultContent$.next(content); } else { throw getEmptyContentTypeError(content); } }; /** * @return {?} */ NzEmptyService.prototype.resetDefault = /** * @return {?} */ function () { this.userDefaultContent$.next(undefined); }; NzEmptyService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ NzEmptyService.ctorParameters = function () { return [ { type: Type, decorators: [{ type: Inject, args: [NZ_DEFAULT_EMPTY_CONTENT,] }, { type: Optional }] } ]; }; /** @nocollapse */ NzEmptyService.ngInjectableDef = i0.defineInjectable({ factory: function NzEmptyService_Factory() { return new i1.NzEmptyService(i0.inject(i1.NZ_DEFAULT_EMPTY_CONTENT, 8)); }, token: i1.NzEmptyService, providedIn: "root" }); return NzEmptyService; }()); export { NzEmptyService }; if (false) { /** @type {?} */ NzEmptyService.prototype.userDefaultContent$; /** * @type {?} * @private */ NzEmptyService.prototype.defaultEmptyContent; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotZW1wdH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