UNPKG

@ngx-ssr/platform

Version:

Install package

23 lines 1.43 kB
import { Directive, Inject, TemplateRef, ViewContainerRef, } from '@angular/core'; import { IS_SERVER_PLATFORM } from './tokens'; import * as i0 from "@angular/core"; export class IfIsServerDirective { constructor(isServer, templateRef, viewContainer) { if (isServer) { viewContainer.createEmbeddedView(templateRef); } } } IfIsServerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: IfIsServerDirective, deps: [{ token: IS_SERVER_PLATFORM }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); IfIsServerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.8", type: IfIsServerDirective, selector: "[ifIsServer]", ngImport: i0 }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: IfIsServerDirective, decorators: [{ type: Directive, args: [{ // eslint-disable-next-line @angular-eslint/directive-selector selector: '[ifIsServer]', }] }], ctorParameters: function () { return [{ type: undefined, decorators: [{ type: Inject, args: [IS_SERVER_PLATFORM] }] }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } }); //# sourceMappingURL=if-is-server.directive.js.map