Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import 'angular2-universal-polyfills';
import 'zone.js';
import { enableProdMode } from '@angular/core';
import { platformNodeDynamic } from 'angular2-universal';
import { AppModule } from './app/app.module';
enableProdMode();
const platform = platformNodeDynamic();
export default function (params: any) : Promise<{ html: string, globals?: any }> {
return new Promise((resolve, reject) => {
const requestZone = Zone.current.fork({
name: 'angular-universal request',
properties: {
baseUrl: '/',
requestUrl: params.url,
originUrl: params.origin,
preboot: false,
// TODO: Render just the component instead of wrapping it inside an extra HTML document
// Waiting on https://github.com/angular/universal/issues/347
document: ''
},
onHandleError: (parentZone, currentZone, targetZone, error) => {
// If any error occurs while rendering the module, reject the whole operation
import 'angular2-universal-polyfills';
import 'angular2-universal-patch';
import 'zone.js';
import { createServerRenderer, RenderResult } from 'aspnet-prerendering';
import { enableProdMode } from '@angular/core';
import { platformNodeDynamic } from 'angular2-universal';
import { AppModule } from './app/app.module';
enableProdMode();
const platform = platformNodeDynamic();
export default createServerRenderer(params => {
return new Promise((resolve, reject) => {
const requestZone = Zone.current.fork({
name: 'angular-universal request',
properties: {
baseUrl: '/',
requestUrl: params.url,
originUrl: params.origin,
preboot: false,
document: ''
},
onHandleError: (parentZone, currentZone, targetZone, error) => {
// If any error occurs while rendering the module, reject the whole operation
reject(error);
return true;
import 'angular2-universal-polyfills';
import 'zone.js';
import { enableProdMode } from '@angular/core';
import { platformNodeDynamic, NodePlatform } from 'angular2-universal';
import { AppModule } from './app/app.module';
enableProdMode();
const platform: NodePlatform = platformNodeDynamic();
export default function (params: any): Promise<{ html: string, globals?: any }> {
return new Promise((resolve: any, reject: any) => {
const requestZone: Zone = Zone.current.fork({
name: 'angular-universal request',
properties: {
baseUrl: '/',
requestUrl: params.url,
originUrl: params.origin,
preboot: false,
// TODO: Render just the component instead of wrapping it inside an extra HTML document
// Waiting on https://github.com/angular/universal/issues/347
document: ''
},
onHandleError: (parentZone: ZoneDelegate, currentZone: Zone, targetZone: Zone, error: any): any => {
// If any error occurs while rendering the module, reject the whole operation
import 'angular2-universal-polyfills';
import 'zone.js';
import { enableProdMode } from '@angular/core';
import { platformNodeDynamic } from 'angular2-universal';
import { AppModule } from './app/app.module';
enableProdMode();
const platform = platformNodeDynamic();
export default function (params: any) : Promise<{ html: string, globals?: any }> {
const requestZone = Zone.current.fork({
name: 'angular-universal request',
properties: {
baseUrl: '/',
requestUrl: params.url,
originUrl: params.origin,
preboot: false,
// TODO: Render just the component instead of wrapping it inside an extra HTML document
// Waiting on https://github.com/angular/universal/issues/347
document: ''
}
});
return requestZone.run>(() => platform.serializeModule(AppModule))
import 'angular2-universal-polyfills/node';
import './__2.1.1.workaround.ts';
import 'zone.js';
import { enableProdMode } from '@angular/core';
import { platformNodeDynamic } from 'angular2-universal';
import { createServerRenderer, RenderResult } from 'aspnet-prerendering';
// Grab the (Node) server-specific NgModule
import { AppServerModule } from './app/platform-modules/app.server.module';
import { metaStore } from 'app-shared';
enableProdMode();
const platform = platformNodeDynamic();
export default createServerRenderer(params => {
// Our Root application document
const doc = '';
return new Promise((resolve, reject) => {
const requestZone = Zone.current.fork({
name: 'Angular-Universal Request',
properties: {
ngModule: AppServerModule,
baseUrl: '/',
requestUrl: params.url,
originUrl: params.origin,
preboot: false,
document: doc