diff --git a/package.json b/package.json index d29fdbd..5e07828 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng2-md-datatable", - "version": "1.3.15", + "version": "1.3.16", "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", diff --git a/src/demo-app/package.json b/src/demo-app/package.json index 17f2c4e..06291d4 100644 --- a/src/demo-app/package.json +++ b/src/demo-app/package.json @@ -26,7 +26,7 @@ "core-js": "^2.4.1", "hammerjs": "^2.0.8", "lodash-es": "^4.17.4", - "ng2-md-datatable": "~1.3.10", + "ng2-md-datatable": "file:../../dist/ng2-md-datatable", "rxjs": "^5.0.0", "web-animations-js": "^2.2.5", "zone.js": "^0.8.5" diff --git a/src/lib/md-datatable.component.ts b/src/lib/md-datatable.component.ts index bec0e65..3c8e816 100644 --- a/src/lib/md-datatable.component.ts +++ b/src/lib/md-datatable.component.ts @@ -43,17 +43,21 @@ export class MdDataTableComponent extends BaseComponent implements AfterContentI @Input() set selectable(val: any) { - if (typeof(val) === 'boolean') { + if (typeof (val) === 'boolean') { this.isSelectable = val; - } else { - this.isSelectable = JSON.parse(val); + } else if (typeof (val) === 'string' && val.length > 0) { + try { + this.isSelectable = JSON.parse(val); + } catch (e) { + console.error(e); + } } } @Output() selectionChange: EventEmitter = - new EventEmitter(false); + new EventEmitter(false); @Output() sortChange: EventEmitter = - new EventEmitter(false); + new EventEmitter(false); @ContentChild(forwardRef(() => MdDataTableHeaderComponent)) headerCmp: MdDataTableHeaderComponent; @ContentChildren(MdDataTableRowComponent) rowsCmp: QueryList;