How to use the angular2-universal/browser.platformUniversalDynamic function in angular2-universal

To help you get started, we’ve selected a few angular2-universal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angular / universal-starter / src / client.ts View on Github external
import 'ts-helpers';
import './__workaround.browser'; // temporary until 2.1.1 things are patched in Core

// Angular 2
import { enableProdMode } from '@angular/core';
import { platformUniversalDynamic } from 'angular2-universal/browser';
import { bootloader } from '@angularclass/bootloader';

import { load as loadWebFont } from 'webfontloader';

// enable prod for faster renders
// enableProdMode();

import { MainModule } from './browser.module';

export const platformRef = platformUniversalDynamic();

// on document ready bootstrap Angular 2
export function main() {
  // Load fonts async
  // https://github.com/typekit/webfontloader#configuration
  loadWebFont({
    google: {
      families: ['Droid Sans']
    }
  });

  return platformRef.bootstrapModule(MainModule);
}

// support async tag or hmr
bootloader(main);
github splincode / meetups / 2017 / july / examples / universal / universal-angular2 / src / client.ts View on Github external
import 'ts-helpers';
import './__workaround.browser'; // temporary until 2.1.1 things are patched in Core

// Angular 2
import { enableProdMode } from '@angular/core';
import { platformUniversalDynamic } from 'angular2-universal/browser';
import { bootloader } from '@angularclass/bootloader';

import { load as loadWebFont } from 'webfontloader';

// enable prod for faster renders
// enableProdMode();

import { MainModule } from './browser.module';

export const platformRef = platformUniversalDynamic();

// on document ready bootstrap Angular 2
export function main() {
  // Load fonts async
  // https://github.com/typekit/webfontloader#configuration
  loadWebFont({
    google: {
      families: ['Droid Sans']
    }
  });

  return platformRef.bootstrapModule(MainModule);
}

// support async tag or hmr
bootloader(main);
github mean-expert-official / fireloop.io / fireloop-cli / generator-fireloop / templates / universal / app.browser.module.ts View on Github external
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SDKBrowserModule } from '../app/shared/sdk/index';

import {
  isBrowser,
  UniversalModule,
  platformUniversalDynamic
} from 'angular2-universal/browser';

import { AppComponent } from '../app/app.component';


export const platform = platformUniversalDynamic();

@NgModule({
  bootstrap: [ AppComponent ],
  declarations: [ AppComponent ],
  imports: [
    UniversalModule,
    FormsModule,
    SDKBrowserModule.forRoot()
  ],
  providers: [

  ]
})
export class MainModule {
}
github angular / universal / examples / express / src / app.browser.module.ts View on Github external
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

import {
  isBrowser,
  UniversalModule,
  platformUniversalDynamic
} from 'angular2-universal/browser';

import { App, Wat } from './app';


export const platform = platformUniversalDynamic();

@NgModule({
  bootstrap: [ App ],
  declarations: [ App, Wat ],
  imports: [
    UniversalModule,
    FormsModule
  ],
  providers: [

  ]
})
export class MainModule {
}

export function main() {
github angular / universal / examples / hello-world / src / app.browser.module.ts View on Github external
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

import {
  isBrowser,
  UniversalModule,
  platformUniversalDynamic
} from 'angular2-universal/browser';

import { App, Wat } from './app';


export const platform = platformUniversalDynamic();

export function main() {
  @NgModule({
    bootstrap: [ App ],
    declarations: [ App, Wat ],
    imports: [
      UniversalModule,
      FormsModule
    ],
    providers: [

    ]
  })
  class MainModule {
  }