diff --git a/src/select2.js b/src/select2.js index c3b99ae..25dd103 100644 --- a/src/select2.js +++ b/src/select2.js @@ -168,6 +168,10 @@ angular.module('ui.select2', []).value('uiSelect2Config', {}).directive('uiSelec if (scope.$$phase || scope.$root.$$phase) { return; } + + if(opts.formatModel){ + controller.$parsers.unshift(opts.formatModel); + } scope.$apply(function () { controller.$setViewValue( convertToAngularModel(elm.select2('data')));