On model variable change, the UI doesn't get the change because the trigger call is missing.
Fix UI refresh on programmatic change
What does this fix exactly since you're setting the value using elm.select2('val') or ('data')?
There is also no explanation as to why it's wrapped in a timeout.
Triggering the change event fixes the asynchrony of the element and the select2 UI.
It's wrapped in a timeout (like 10 rows below) because the change event that get's triggered (20 rows below) uses the scope.$apply function that raises an error if called during $digest and with $timeout you avoid that.
I don't know why you are criticizing this solution (the $timeout) when it's already used in this file.
Maybe the issue I have is caused by using ng-options that is not suggested, but I can't avoid.
I use ng-options because I can do something like ng-options="car.model group by car.make for car in cars" and have the options grouped. Is there another way?
ng-options="car.model group by car.make for car in cars"
I can't make this work without $timeout because I keep getting error about digest already in progress.
Do you mind relocating this to https://github.com/angular-ui/ui-select2