daniel-nagy / md-data-table

Material Design Data Table for Angular Material
MIT License
1.9k stars 520 forks source link

BUG: md-select-id equals to 0 does not working #590

Open chicomarques90 opened 7 years ago

chicomarques90 commented 7 years ago

When my md-select-id equals to zero then the UI does not select the corresponding row.

Take a look at the code snippet (file "mdSelect.js")

    self.isSelected = function () {
      if(!tableCtrl.$$rowSelect) {
        return false;
      }

      if(self.id) { //<<<<<<<The problem is here because 0 equals false
        return tableCtrl.$$hash.has(self.id);
      }

      return tableCtrl.selected.indexOf(self.model) !== -1;
    };