nodram
Version:
A Really MEAN Web Framework
30 lines (24 loc) • 848 B
text/typescript
// the polyfills must be the first thing imported
import 'angular2-universal-polyfills';
import 'ts-helpers';
import './helpers/__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 { MainModule } from './browser.module';
enableProdMode();
export const platformRef = platformUniversalDynamic();
// on document ready bootstrap Angular 2
export function main() {
return platformRef.bootstrapModule(MainModule);
}
// support async tag or hmr
switch (document.readyState) {
case 'interactive':
case 'complete':
main();
break;
case 'loading':
default:
document.addEventListener('DOMContentLoaded', () => main());
}