Skip to content

Commit

Permalink
#2
Browse files Browse the repository at this point in the history
Fixed AOT build by making reducers an exported function and deleting the un-used navbar module.
  • Loading branch information
Marin Petkov committed May 23, 2017
1 parent d5c6276 commit 44420b8
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 90 deletions.
32 changes: 20 additions & 12 deletions src/client/app/app.module.ts
Expand Up @@ -3,7 +3,9 @@ import { BrowserModule } from '@angular/platform-browser';
import { APP_BASE_HREF } from '@angular/common';
import { RouterModule } from '@angular/router';
import { HttpModule } from '@angular/http';
import { StoreModule } from '@ngrx/store';
import { StoreModule, combineReducers } from '@ngrx/store';
import { compose } from '@ngrx/core';

import { AppComponent } from './app.component';
import { appRoutes } from './app.routes';

Expand Down Expand Up @@ -32,22 +34,28 @@ import { WatchlistModule } from './watchlist/watchlist.module';
import { AppActions } from './state/app.actions';
import { HeaderActions } from './shared/header/state/header.actions';

export function rootReducer(state: any, action: any) {
const reducer = compose(combineReducers)({
app: appReducer,
header: headerReducer,
watchlist: watchlistReducer,
favorites: favoritesReducer,
sidebar: sidebarReducer,
search: searchReducer,
chart: chartReducer,
news: newsReducer,
info: infoReducer
});

return reducer(state, action);
}

@NgModule({
imports: [
BrowserModule,
HttpModule,
RouterModule.forRoot(appRoutes, {useHash: true}),
StoreModule.provideStore({
app: appReducer,
header: headerReducer,
watchlist: watchlistReducer,
favorites: favoritesReducer,
sidebar: sidebarReducer,
search: searchReducer,
chart: chartReducer,
news: newsReducer,
info: infoReducer
}),
StoreModule.provideStore(rootReducer),
SharedModule,
HeaderModule,
WatchlistModule
Expand Down
1 change: 0 additions & 1 deletion src/client/app/shared/index.ts
@@ -1,4 +1,3 @@
export * from './header/index';
export * from './navbar/index';
export * from './notification/index';
export * from './search-box/index';
1 change: 0 additions & 1 deletion src/client/app/shared/navbar/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/client/app/shared/navbar/navbar.component.html

This file was deleted.

6 changes: 0 additions & 6 deletions src/client/app/shared/navbar/navbar.component.scss

This file was deleted.

37 changes: 0 additions & 37 deletions src/client/app/shared/navbar/navbar.component.spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/client/app/shared/navbar/navbar.component.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/client/app/shared/navbar/navbar.module.ts

This file was deleted.

0 comments on commit 44420b8

Please sign in to comment.