Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* This file and `main.browser.ts` are identical, at the moment(!)
* By modifying the uniqueTo* definitions, you're able to create logic,
* imports, etc that are "Platform" specific.
*
* If you want your code to be completely Universal and don't need that
* You can also modiy just the commonModule definition
*
*/

import { NgModule } from '@angular/core';
import { UniversalModule } from 'angular2-universal';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './index';
// import { RouterModule } from '@angular/router';
// import { appRoutes } from './app/app.routing';

const commonModule = {
/** Root App Component */
bootstrap: [AppComponent],
/** Our Components */
declarations: [AppComponent],
imports: [
/**
* NOTE: Needs to be your first import (!)
* NodeModule, NodeHttpModule, NodeJsonpModule are included
*/
UniversalModule,
FormsModule,
/**
* using routes
*/
// RouterModule.forRoot(appRoutes)
],
providers: []
};

const uniqueToClientModule = {
bootstrap: [],
declarations: [],
imports: [],
providers: []
};

const uniqueToServerModule = {
bootstrap: [],
declarations: [],
imports: [],
providers: []
};

/**
* Top-level NgModule "container"
*/
@NgModule({
bootstrap: [...commonModule.bootstrap, uniqueToClientModule.bootstrap],
declarations: [...commonModule.declarations, uniqueToClientModule.declarations],
imports: [...commonModule.imports, uniqueToClientModule.imports],
providers: [...commonModule.providers, uniqueToClientModule.providers]
})
export class AppModule {

}

@NgModule({
bootstrap: [...commonModule.bootstrap, uniqueToServerModule.bootstrap],
declarations: [...commonModule.declarations, uniqueToServerModule.declarations],
imports: [...commonModule.imports, uniqueToServerModule.imports],
providers: [...commonModule.providers, uniqueToServerModule.providers]
})
export class AppNodeModule {

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import './__2.1.1.workaround.ts'; // temporary until 2.1.1 things are patched in
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
import { platformUniversalDynamic } from 'angular2-universal';
import { AppModule } from './app/app.browser.module';
import { AppModule } from './app/app.module';

/**
* enable prod mode for production environments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as express from 'express';
import * as compression from 'compression';
import { createEngine } from 'angular2-express-engine';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app/app.node.module';
import { AppNodeModule } from './app/app.module';
import { environment } from './environments/environment';
import { routes } from './server.routes';

Expand Down Expand Up @@ -56,7 +56,7 @@ function ngApp(req: any, res: any) {
res.render('index', {
req,
res,
ngModule: AppModule,
ngModule: AppNodeModule,
preboot: false,
baseUrl: '/',
requestUrl: req.originalUrl,
Expand Down