UNPKG

@obliczeniowo/elementary

Version:
97 lines (91 loc) 4.23 kB
import { isPlatformBrowser, isPlatformServer } from '@angular/common'; import * as i0 from '@angular/core'; import { PLATFORM_ID, Inject, Injectable, Directive } from '@angular/core'; class SsrService { platformId; constructor(platformId) { this.platformId = platformId; } isBrowser() { return isPlatformBrowser(this.platformId); } isServer() { return isPlatformServer(this.platformId); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: SsrService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: SsrService, providedIn: 'root' }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: SsrService, decorators: [{ type: Injectable, args: [{ providedIn: 'root' }] }], ctorParameters: () => [{ type: undefined, decorators: [{ type: Inject, args: [PLATFORM_ID] }] }] }); class SsrExcludeDirective { platformId; templateRef; viewContainer; constructor(platformId, templateRef, viewContainer) { this.platformId = platformId; this.templateRef = templateRef; this.viewContainer = viewContainer; } ngOnInit() { if (isPlatformServer(this.platformId)) { this.viewContainer.clear(); } else { this.viewContainer.createEmbeddedView(this.templateRef); } } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: SsrExcludeDirective, deps: [{ token: PLATFORM_ID }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.4", type: SsrExcludeDirective, isStandalone: true, selector: "[oblSsrExclude]", ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: SsrExcludeDirective, decorators: [{ type: Directive, args: [{ selector: '[oblSsrExclude]', standalone: true }] }], ctorParameters: () => [{ type: undefined, decorators: [{ type: Inject, args: [PLATFORM_ID] }] }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }] }); class BsrExcludeDirective { platformId; templateRef; viewContainer; constructor(platformId, templateRef, viewContainer) { this.platformId = platformId; this.templateRef = templateRef; this.viewContainer = viewContainer; } ngOnInit() { if (isPlatformServer(this.platformId)) { this.viewContainer.clear(); } else { this.viewContainer.createEmbeddedView(this.templateRef); } } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: BsrExcludeDirective, deps: [{ token: PLATFORM_ID }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.4", type: BsrExcludeDirective, isStandalone: true, selector: "[oblBsrExclude]", ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: BsrExcludeDirective, decorators: [{ type: Directive, args: [{ selector: '[oblBsrExclude]', standalone: true }] }], ctorParameters: () => [{ type: undefined, decorators: [{ type: Inject, args: [PLATFORM_ID] }] }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }] }); /** * Generated bundle index. Do not edit. */ export { BsrExcludeDirective, SsrExcludeDirective, SsrService }; //# sourceMappingURL=obliczeniowo-elementary-ssr.mjs.map