```coffeescript
angular.module("admin.indexUtils").directive "select2MinSearch", ($timeout) ->
  require: 'ngModel'
  link: (scope, element, attrs, ngModel) ->
    element.select2
      minimumResultsForSearch: attrs.select2MinSearch

    scope.$watch attrs.ngModel, (newVal, oldVal) ->
      $timeout -> element.trigger('change')
```

Change the way changes to underlying model are watched and updated for select2 elements
user
```coffeescript
angular.module("admin.indexUtils").directive "select2MinSearch", ($timeout) ->
  require: 'ngModel'
  link: (scope, element, attrs, ngModel) ->
    element.select2
      minimumResultsForSearch: attrs.select2MinSearch

    ngModel.$formatters.push (value) ->
      element.select2('val', value)
      value
```
assistant