UNPKG

@ngx-ssr/platform

Version:

Install package

117 lines (106 loc) 6.57 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common')) : typeof define === 'function' && define.amd ? define('@ngx-ssr/platform', ['exports', '@angular/core', '@angular/common'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["ngx-ssr"] = global["ngx-ssr"] || {}, global["ngx-ssr"].platform = {}), global.ng.core, global.ng.common)); })(this, (function (exports, i0, common) { 'use strict'; function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n["default"] = e; return Object.freeze(n); } var i0__namespace = /*#__PURE__*/_interopNamespace(i0); var IS_SERVER_PLATFORM = new i0.InjectionToken('Is server?', { factory: function () { var platform = i0.inject(i0.PLATFORM_ID); return common.isPlatformServer(platform); }, }); var IS_BROWSER_PLATFORM = new i0.InjectionToken('Is browser?', { factory: function () { var platform = i0.inject(i0.PLATFORM_ID); return common.isPlatformBrowser(platform); }, }); var IfIsServerDirective = /** @class */ (function () { function IfIsServerDirective(isServer, templateRef, viewContainer) { if (isServer) { viewContainer.createEmbeddedView(templateRef); } } return IfIsServerDirective; }()); IfIsServerDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: IfIsServerDirective, deps: [{ token: IS_SERVER_PLATFORM }, { token: i0__namespace.TemplateRef }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Directive }); IfIsServerDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.8", type: IfIsServerDirective, selector: "[ifIsServer]", ngImport: i0__namespace }); i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: IfIsServerDirective, decorators: [{ type: i0.Directive, args: [{ // eslint-disable-next-line @angular-eslint/directive-selector selector: '[ifIsServer]', }] }], ctorParameters: function () { return [{ type: undefined, decorators: [{ type: i0.Inject, args: [IS_SERVER_PLATFORM] }] }, { type: i0__namespace.TemplateRef }, { type: i0__namespace.ViewContainerRef }]; } }); var IfIsBrowserDirective = /** @class */ (function () { function IfIsBrowserDirective(isBrowser, templateRef, viewContainer) { if (isBrowser) { viewContainer.createEmbeddedView(templateRef); } } return IfIsBrowserDirective; }()); IfIsBrowserDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: IfIsBrowserDirective, deps: [{ token: IS_BROWSER_PLATFORM }, { token: i0__namespace.TemplateRef }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Directive }); IfIsBrowserDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.8", type: IfIsBrowserDirective, selector: "[ifIsBrowser]", ngImport: i0__namespace }); i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: IfIsBrowserDirective, decorators: [{ type: i0.Directive, args: [{ // eslint-disable-next-line @angular-eslint/directive-selector selector: '[ifIsBrowser]', }] }], ctorParameters: function () { return [{ type: undefined, decorators: [{ type: i0.Inject, args: [IS_BROWSER_PLATFORM] }] }, { type: i0__namespace.TemplateRef }, { type: i0__namespace.ViewContainerRef }]; } }); var NgxSsrPlatformModule = /** @class */ (function () { function NgxSsrPlatformModule() { } return NgxSsrPlatformModule; }()); NgxSsrPlatformModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: NgxSsrPlatformModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule }); NgxSsrPlatformModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: NgxSsrPlatformModule, declarations: [IfIsBrowserDirective, IfIsServerDirective], imports: [common.CommonModule], exports: [IfIsBrowserDirective, IfIsServerDirective] }); NgxSsrPlatformModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: NgxSsrPlatformModule, imports: [[common.CommonModule]] }); i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: NgxSsrPlatformModule, decorators: [{ type: i0.NgModule, args: [{ imports: [common.CommonModule], declarations: [IfIsBrowserDirective, IfIsServerDirective], exports: [IfIsBrowserDirective, IfIsServerDirective], }] }] }); /** * Generated bundle index. Do not edit. */ exports.IS_BROWSER_PLATFORM = IS_BROWSER_PLATFORM; exports.IS_SERVER_PLATFORM = IS_SERVER_PLATFORM; exports.IfIsBrowserDirective = IfIsBrowserDirective; exports.IfIsServerDirective = IfIsServerDirective; exports.NgxSsrPlatformModule = NgxSsrPlatformModule; Object.defineProperty(exports, '__esModule', { value: true }); })); //# sourceMappingURL=ngx-ssr-platform.umd.js.map