Skip to content

Commit

Permalink
Added event emit for input change
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Dec 15, 2016
1 parent f954ecc commit 81b90f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/select2.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,13 @@ export class Select2Component implements AfterViewInit, OnChanges, OnDestroy {
}

if(changes['value'] && changes['value'].previousValue !== changes['value'].currentValue) {
this.element.val(changes['value'].currentValue);
const newValue: string = changes['value'].currentValue;

this.element.val(newValue);
this.element.trigger('change.select2');
this.valueChanged.emit({
value: newValue
});
}
}

Expand Down

0 comments on commit 81b90f9

Please # to comment.