mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-25 19:17:30 +00:00
ng2 2.0, Universal 2.0, TS 2.0, Preboot 4.*
This commit is contained in:
committed by
SteveSandersonMS
parent
b71d139eb5
commit
ce0d2089d2
@@ -1,21 +1,30 @@
|
||||
// the polyfills must be the first thing imported
|
||||
import 'angular2-universal-polyfills';
|
||||
|
||||
import 'es6-shim';
|
||||
require('zone.js');
|
||||
import 'bootstrap';
|
||||
import 'reflect-metadata';
|
||||
import './styles/site.css';
|
||||
|
||||
import { bootstrap } from '@angular/platform-browser-dynamic';
|
||||
import { FormBuilder } from '@angular/common';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { HTTP_PROVIDERS } from '@angular/http';
|
||||
import { App } from './components/app/app';
|
||||
import { routes } from './routes';
|
||||
// Angular 2
|
||||
import { enableProdMode} from '@angular/core';
|
||||
import { platformUniversalDynamic } from 'angular2-universal';
|
||||
|
||||
// enable prod for faster renders
|
||||
enableProdMode();
|
||||
|
||||
import { MainModule } from './main.browser';
|
||||
|
||||
const platformRef = platformUniversalDynamic();
|
||||
|
||||
// on document ready bootstrap Angular 2
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
platformRef.bootstrapModule(MainModule);
|
||||
|
||||
});
|
||||
|
||||
bootstrap(App, [
|
||||
...HTTP_PROVIDERS,
|
||||
FormBuilder,
|
||||
provideRouter(routes)
|
||||
]);
|
||||
|
||||
// Basic hot reloading support. Automatically reloads and restarts the Angular 2 app each time
|
||||
// you modify source files. This will not preserve any application state other than the URL.
|
||||
|
||||
Reference in New Issue
Block a user