Fix for Angular 1.2.22+

This is a fix so that it works in Angular 1.2.22+ as per http://stackoverflow.com/a/22658709/150953

When we upgraded AngularJS to the latest version we saw that the select was not being updated. This code seems to work better.