Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Ghilini committed Jun 7, 2017
1 parent 5d8be53 commit 59a5825
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/demo-app/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
AfterViewInit,
OnDestroy,
ViewChild,
ChangeDetectorRef,
} from '@angular/core';

import { Observable } from 'rxjs/Observable';
Expand Down Expand Up @@ -49,7 +50,7 @@ export class AppComponent implements AfterViewInit, OnDestroy {

private unmount$: Subject<void> = new Subject<void>();

constructor(private appService: AppService) {
constructor(private appService: AppService, private changeDetectorRef: ChangeDetectorRef) {
this.fetchDemoDataSource();
}

Expand Down Expand Up @@ -82,6 +83,7 @@ export class AppComponent implements AfterViewInit, OnDestroy {
shuffleData() {
this.tshirts$.next(shuffle(this.tshirts$.getValue()));
this.currentSelection$.next([]);
this.changeDetectorRef.detectChanges();
}

private fetchDemoDataSource(
Expand Down
5 changes: 2 additions & 3 deletions src/lib/md-datatable.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
ContentChild,
ContentChildren,
QueryList,
forwardRef,
} from '@angular/core';

import { Observable } from 'rxjs/Observable';
Expand Down Expand Up @@ -53,8 +52,8 @@ export class MdDataTableComponent extends BaseComponent implements AfterContentI
@Output() sortChange: EventEmitter<IDatatableSortEvent> =
new EventEmitter<IDatatableSortEvent>(false);

@ContentChild(forwardRef(() => MdDataTableHeaderComponent)) headerCmp: MdDataTableHeaderComponent;
@ContentChildren(forwardRef(() => MdDataTableRowComponent)) rowsCmp: QueryList<MdDataTableRowComponent>;
@ContentChild(MdDataTableHeaderComponent) headerCmp: MdDataTableHeaderComponent;
@ContentChildren(MdDataTableRowComponent) rowsCmp: QueryList<MdDataTableRowComponent>;

id = `md-datatable-${instanceId++}`;

Expand Down

0 comments on commit 59a5825

Please sign in to comment.