diff --git a/addon/ng2/blueprints/mobile/files/__path__/main-app-shell.ts b/addon/ng2/blueprints/mobile/files/__path__/main-app-shell.ts index 999059f8aa07..7d266b8426a4 100644 --- a/addon/ng2/blueprints/mobile/files/__path__/main-app-shell.ts +++ b/addon/ng2/blueprints/mobile/files/__path__/main-app-shell.ts @@ -1,29 +1,44 @@ +import 'angular2-universal-polyfills'; import { provide } from '@angular/core'; import { APP_BASE_HREF } from '@angular/common'; import { APP_SHELL_BUILD_PROVIDERS } from '@angular/app-shell'; -import { AppComponent } from './app/'; -import { - REQUEST_URL, - ORIGIN_URL +import { + REQUEST_URL, + ORIGIN_URL, + Bootloader, + BootloaderConfig, + AppConfig } from 'angular2-universal'; +import { AppComponent } from './app/'; -export const options = { - directives: [ - // The component that will become the main App Shell - AppComponent - ], +const bootloaderConfig: BootloaderConfig = { platformProviders: [ APP_SHELL_BUILD_PROVIDERS, provide(ORIGIN_URL, { - useValue: '' - }) + useValue: 'http://localhost:4200' // full urls are needed for node xhr + }), + provide(APP_BASE_HREF, { useValue: '/' }), + ], + async: true, + preboot: false +} + +const appConfig: AppConfig = { + directives: [ + // The component that will become the main App Shell + AppComponent ], providers: [ // What URL should Angular be treating the app as if navigating - provide(APP_BASE_HREF, {useValue: '/'}), - provide(REQUEST_URL, {useValue: '/'}) - ], - async: false, - preboot: false -}; + provide(REQUEST_URL, { useValue: '/' }) + ] +} + +export function getBootloader() : Bootloader { + return new Bootloader(bootloaderConfig); +} +export function serialize(bootloader: Bootloader, template: string) : string { + appConfig.template = template; + return bootloader.serializeApplication(appConfig); +} \ No newline at end of file diff --git a/addon/ng2/blueprints/mobile/files/__path__/system-import.js b/addon/ng2/blueprints/mobile/files/__path__/system-import.js deleted file mode 100644 index 40fb651c0954..000000000000 --- a/addon/ng2/blueprints/mobile/files/__path__/system-import.js +++ /dev/null @@ -1,2 +0,0 @@ -System.import('main') - .catch(console.error.bind(console)); diff --git a/addon/ng2/blueprints/ng2/files/__path__/index.html b/addon/ng2/blueprints/ng2/files/__path__/index.html index c800d403bd81..250c1d86e223 100644 --- a/addon/ng2/blueprints/ng2/files/__path__/index.html +++ b/addon/ng2/blueprints/ng2/files/__path__/index.html @@ -5,53 +5,26 @@