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

Commit c419d97

Browse files
committed
add ability to update model value
1 parent 36911dc commit c419d97

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/select2.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,12 @@ angular.module('ui.select2', []).value('uiSelect2Config', {}).directive('uiSelec
168168
if (scope.$$phase || scope.$root.$$phase) {
169169
return;
170170
}
171+
172+
if(opts.formatModel){
173+
controller.$parsers.unshift(opts.formatModel);
174+
}
171175
scope.$apply(function () {
172176
controller.$setViewValue(
173-
if(opts.formatModel){
174-
controller.$parsers.unshift(opts.formatModel);
175-
}
176177
convertToAngularModel(elm.select2('data')));
177178
});
178179
});

0 commit comments

Comments
 (0)