use forRoot on app router, whitelist ngx on server

This commit is contained in:
William Welling
2017-09-26 15:13:36 -05:00
parent 3b90d6fb43
commit bd25a489d0
3 changed files with 10 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component';
@NgModule({ @NgModule({
imports: [ imports: [
RouterModule.forChild([ RouterModule.forRoot([
{ path: '', redirectTo: '/home', pathMatch: 'full' }, { path: '', redirectTo: '/home', pathMatch: 'full' },
{ path: 'home', loadChildren: './+home/home.module#HomeModule' }, { path: 'home', loadChildren: './+home/home.module#HomeModule' },
{ path: 'communities', loadChildren: './+community-page/community-page.module#CommunityPageModule' }, { path: 'communities', loadChildren: './+community-page/community-page.module#CommunityPageModule' },
@@ -15,4 +15,6 @@ import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component';
]) ])
], ],
}) })
export class AppRoutingModule { } export class AppRoutingModule {
}

View File

@@ -3,11 +3,12 @@ import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgxPaginationModule } from 'ngx-pagination';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { NgxPaginationModule } from 'ngx-pagination';
import { PaginationComponent } from './pagination/pagination.component'; import { PaginationComponent } from './pagination/pagination.component';
import { FileSizePipe } from './utils/file-size-pipe'; import { FileSizePipe } from './utils/file-size-pipe';
import { ThumbnailComponent } from '../thumbnail/thumbnail.component'; import { ThumbnailComponent } from '../thumbnail/thumbnail.component';

View File

@@ -11,6 +11,9 @@ module.exports = {
}, },
target: 'node', target: 'node',
externals: [nodeExternals({ externals: [nodeExternals({
whitelist: [/@angular/, /@ng/] whitelist: [
/@angular/,
/@ng/,
/ngx/]
})], })],
}; };