@ -1,18 +1,12 @@
|
||||
import {platform, Provider, NgZone} from "angular2/core";
|
||||
import {
|
||||
WORKER_APP_PLATFORM,
|
||||
WORKER_APP_APPLICATION,
|
||||
WORKER_APP_ROUTER
|
||||
} from "angular2/platform/worker_app";
|
||||
import {App} from "./index_common";
|
||||
import {HashLocationStrategy, LocationStrategy} from "angular2/router";
|
||||
import {platform, Provider, NgZone} from 'angular2/core';
|
||||
import {WORKER_APP_PLATFORM, WORKER_APP_APPLICATION, WORKER_APP_ROUTER} from 'angular2/platform/worker_app';
|
||||
import {App} from './index_common';
|
||||
import {HashLocationStrategy, LocationStrategy} from 'angular2/router';
|
||||
|
||||
export function main() {
|
||||
let refPromise = platform([WORKER_APP_PLATFORM])
|
||||
.asyncApplication(null, [
|
||||
WORKER_APP_APPLICATION,
|
||||
WORKER_APP_ROUTER,
|
||||
new Provider(LocationStrategy, {useClass: HashLocationStrategy})
|
||||
]);
|
||||
let refPromise = platform([WORKER_APP_PLATFORM]).asyncApplication(null, [
|
||||
WORKER_APP_APPLICATION, WORKER_APP_ROUTER,
|
||||
new Provider(LocationStrategy, {useClass: HashLocationStrategy})
|
||||
]);
|
||||
refPromise.then((ref) => ref.bootstrap(App));
|
||||
}
|
||||
|
@ -1,16 +1,8 @@
|
||||
import {platform, Provider} from 'angular2/core';
|
||||
import {
|
||||
WORKER_RENDER_APP,
|
||||
WORKER_RENDER_PLATFORM,
|
||||
WORKER_SCRIPT,
|
||||
WORKER_RENDER_ROUTER
|
||||
} from 'angular2/platform/worker_render';
|
||||
import {BrowserPlatformLocation} from "angular2/src/router/location/browser_platform_location";
|
||||
import {MessageBasedPlatformLocation} from "angular2/src/web_workers/ui/platform_location";
|
||||
import {WORKER_RENDER_APP, WORKER_RENDER_PLATFORM, WORKER_SCRIPT, WORKER_RENDER_ROUTER} from 'angular2/platform/worker_render';
|
||||
import {BrowserPlatformLocation} from 'angular2/src/router/location/browser_platform_location';
|
||||
import {MessageBasedPlatformLocation} from 'angular2/src/web_workers/ui/platform_location';
|
||||
|
||||
let ref = platform([WORKER_RENDER_PLATFORM])
|
||||
.application([
|
||||
WORKER_RENDER_APP,
|
||||
new Provider(WORKER_SCRIPT, {useValue: "loader.js"}),
|
||||
WORKER_RENDER_ROUTER
|
||||
]);
|
||||
let ref = platform([WORKER_RENDER_PLATFORM]).application([
|
||||
WORKER_RENDER_APP, new Provider(WORKER_SCRIPT, {useValue: 'loader.js'}), WORKER_RENDER_ROUTER
|
||||
]);
|
@ -6,9 +6,9 @@ import {ROUTER_DIRECTIVES, RouteConfig, Route} from 'angular2/router';
|
||||
|
||||
@Component({selector: 'app', directives: [ROUTER_DIRECTIVES], templateUrl: 'app.html'})
|
||||
@RouteConfig([
|
||||
new Route({path: '/', component: Start, name: "Start"}),
|
||||
new Route({path: '/contact', component: Contact, name: "Contact"}),
|
||||
new Route({path: '/about', component: About, name: "About"})
|
||||
new Route({path: '/', component: Start, name: 'Start'}),
|
||||
new Route({path: '/contact', component: Contact, name: 'Contact'}),
|
||||
new Route({path: '/about', component: About, name: 'About'})
|
||||
])
|
||||
export class App {
|
||||
}
|
||||
|
Reference in New Issue
Block a user