Skip to content

Commit

Permalink
Fixed selectable attribute not working with an expression [selectable…
Browse files Browse the repository at this point in the history
…]="expression"
  • Loading branch information
Frederic Ghilini committed Jun 7, 2017
1 parent 59a5825 commit 14001d0
Show file tree
Hide file tree
Showing 2 changed files with 6 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.3.14",
"version": "1.3.15",
"description": "Angular 2 DataTable component for using with Material 2",
"main": "dist/ng2-md-datatable/ng2-md-datatable.umd.js",
"module": "dist/ng2-md-datatable/index.js",
Expand Down
8 changes: 5 additions & 3 deletions src/lib/md-datatable.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* tslint:disable:triple-equals */

import {
Component,
AfterContentInit,
Expand Down Expand Up @@ -44,7 +42,11 @@ export class MdDataTableComponent extends BaseComponent implements AfterContentI

@Input()
set selectable(val: any) {
this.isSelectable = val == 'true';
if (typeof(val) === 'boolean') {
this.isSelectable = val;
} else {
this.isSelectable = JSON.parse(val);
}
}

@Output() selectionChange: EventEmitter<IDatatableSelectionEvent> =
Expand Down

0 comments on commit 14001d0

Please sign in to comment.