refactor(docs-infra): update universal example to match latest CLI (#36483)

Update the `universal` example (and related files) to match what would
be generated by the latest CLI.

Fixes #35289

PR Close #36483
This commit is contained in:
George Kalpakas
2020-04-08 15:27:42 +03:00
committed by atscott
parent 4d9da9b0a1
commit ec5c108b60
13 changed files with 950 additions and 293 deletions

View File

@ -1,6 +1,5 @@
import { NgModule } from '@angular/core';
import { ServerModule } from '@angular/platform-server';
import { ModuleMapLoaderModule } from '@nguniversal/module-map-ngfactory-loader';
import { AppModule } from './app.module';
import { AppComponent } from './app.component';
@ -9,11 +8,10 @@ import { AppComponent } from './app.component';
imports: [
AppModule,
ServerModule,
ModuleMapLoaderModule
],
providers: [
// Add universal-only providers here
],
bootstrap: [ AppComponent ],
bootstrap: [AppComponent],
})
export class AppServerModule {}

View File

@ -8,5 +8,7 @@ if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
document.addEventListener('DOMContentLoaded', () => {
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
});