Skip to content

Commit

Permalink
fix for AOT
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Ghilini committed Apr 10, 2017
1 parent 05e4989 commit 972ff60
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng2-md-datatable",
"version": "1.2.0",
"version": "1.2.1",
"description": "Angular 2 DataTable component for using with Material 2",
"main": "dist/index.js",
"scripts": {
Expand Down
5 changes: 5 additions & 0 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';

import { datatableReducer } from './md-datatable.reducer';

// I had to use these private things... :(
// Hope that this can be improved when @ngrx/store 4.x is releases
import {
Expand Down Expand Up @@ -58,6 +60,9 @@ export function customFeatureStoreModule(
};
}

// static export (for AOT)
export const CustomFeatureStoreModule: ModuleWithProviders = customFeatureStoreModule(datatableReducer);

// I don't get why we don't have this unmount$ observable as default in Angular...
export abstract class BaseComponent implements OnDestroy {
unmount$: Observable<void>;
Expand Down
5 changes: 2 additions & 3 deletions src/md-datatable.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ import { MdDataTableHeaderComponent } from './md-datatable-header.component';
import { MdDataTableColumnComponent } from './md-datatable-column.component';
import { MdDataTableRowComponent } from './md-datatable-row.component';
import { MdDataTablePaginationComponent } from './md-datatable-pagination.component';
import { customFeatureStoreModule } from './helpers';
import { datatableReducer } from './md-datatable.reducer';
import { CustomFeatureStoreModule } from './helpers';
import { MdDatatableActions } from './md-datatable.actions';

@NgModule({
imports: [
CommonModule,
MaterialModule,
FormsModule,
customFeatureStoreModule(datatableReducer),
CustomFeatureStoreModule,
],
declarations: [
MdDataTableComponent,
Expand Down

0 comments on commit 972ff60

Please sign in to comment.