Skip to content

Commit

Permalink
Finer tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Ghilini committed Apr 18, 2017
1 parent 0ee33f4 commit 7b0df24
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 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.3.0",
"version": "1.3.1",
"description": "Angular 2 DataTable component for using with Material 2",
"main": "dist/index.js",
"scripts": {
Expand Down
4 changes: 0 additions & 4 deletions src/demo-app/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Subject } from 'rxjs/Subject';
import { async } from 'rxjs/scheduler/async';
import 'rxjs/add/observable/from';
import 'rxjs/add/operator/do';
import 'rxjs/add/operator/observeOn';
import 'rxjs/add/operator/takeUntil';

import {
Expand Down Expand Up @@ -53,18 +52,15 @@ export class AppComponent implements AfterViewInit, OnDestroy {
ngAfterViewInit() {
if (this.datatable) {
Observable.from(this.datatable.selectionChange)
.observeOn(async)
.takeUntil(this.unmount$)
.subscribe((e: IDatatableSelectionEvent) => this.currentSelection = e.selectedValues);

Observable.from(this.datatable.sortChange)
.observeOn(async)
.takeUntil(this.unmount$)
.subscribe((e: IDatatableSortEvent) =>
this.fetchDemoDataSource(this.currentPage, this.itemsPerPage, e.sortBy, e.sortType));

Observable.from(this.pagination.paginationChange)
.observeOn(async)
.takeUntil(this.unmount$)
.subscribe((e: IDatatablePaginationEvent) =>
this.fetchDemoDataSource(e.page, e.itemsPerPage));
Expand Down
1 change: 1 addition & 0 deletions src/demo-app/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import 'hammerjs';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
Expand Down
2 changes: 0 additions & 2 deletions src/lib/md-datatable-header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { async } from 'rxjs/scheduler/async';
import 'rxjs/add/operator/let';
import 'rxjs/add/operator/observeOn';
import 'rxjs/add/operator/takeUntil';

import { BaseComponent } from './helpers';
Expand Down Expand Up @@ -63,7 +62,6 @@ export class MdDataTableHeaderComponent extends BaseComponent implements AfterVi

this.store
.let(areAllRowsSelected(this.datatableId))
.observeOn(async)
.takeUntil(this.unmount$)
.subscribe(this.allChecked$);
}
Expand Down
2 changes: 0 additions & 2 deletions src/lib/md-datatable-row.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { MdCheckbox, MdCheckboxChange } from '@angular/material';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { async } from 'rxjs/scheduler/async';
import 'rxjs/add/operator/let';
import 'rxjs/add/operator/observeOn';
import 'rxjs/add/operator/takeUntil';

import { BaseComponent } from './helpers';
Expand Down Expand Up @@ -81,7 +80,6 @@ export class MdDataTableRowComponent extends BaseComponent implements AfterViewI

this.store
.let(isRowSelected(this.datatableId, this.selectableValue))
.observeOn(async)
.takeUntil(this.unmount$)
.subscribe(this.checked$);
}
Expand Down
19 changes: 18 additions & 1 deletion src/lib/md-datatable.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@ import {
} from '@angular/core';

import { CommonModule } from '@angular/common';
import { MdCheckboxModule, MdSelectModule, MdButtonModule, MdIconModule } from '@angular/material';

import {
MdCoreModule,
A11yModule,
MdCheckboxModule,
MdInputModule,
MdSelectModule,
MdOptionModule,
MdButtonModule,
MdIconModule,
MdRippleModule,
} from '@angular/material';

import { FormsModule } from '@angular/forms';

import { MdDataTableComponent } from './md-datatable.component';
Expand All @@ -27,10 +39,15 @@ import { MdDatatableActions } from './md-datatable.actions';
imports: [
CommonModule,
FormsModule,
MdCoreModule,
A11yModule,
MdCheckboxModule,
MdInputModule,
MdSelectModule,
MdOptionModule,
MdButtonModule,
MdIconModule,
MdRippleModule,
],
declarations: [
MdDataTableComponent,
Expand Down

0 comments on commit 7b0df24

Please sign in to comment.