Skip to content

Commit

Permalink
feat: allow number valueField (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregcop1 authored and NicholasAzar committed Dec 2, 2017
1 parent 3f716fa commit 6779b34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ng-selectize.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class NgSelectizeComponent implements OnInit, OnChanges, DoCheck, Control
this.selectize.addOption(cloneDeep(option));
const valueField = this.getValueField();
if (this.value) {
const items = typeof this.value === 'string' ? [this.value] : this.value;
const items = (typeof this.value === 'string' || typeof this.value === 'number') ? [this.value] : this.value;
if (items && items instanceof Array && items.find(value => value === option[valueField])) {
this.selectize.addItem(option[valueField], true);
}
Expand Down

0 comments on commit 6779b34

Please sign in to comment.