Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Commit

Permalink
fix(backcompat): Adding a check for controller.$setPristine before ca…
Browse files Browse the repository at this point in the history
…lling
  • Loading branch information
Dean Sofer committed Nov 23, 2013
1 parent 26e4a5d commit ff3ce10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/select2.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ angular.module('ui.select2', []).value('uiSelect2Config', {}).directive('uiSelec
elm.select2('val', controller.$viewValue);
// Refresh angular to remove the superfluous option
elm.trigger('change');
if(newVal && !oldVal) {
if(newVal && !oldVal && controller.$setPristine) {
controller.$setPristine(true);
}
});
Expand Down

0 comments on commit ff3ce10

Please sign in to comment.