angular-ui/ui-select2 — pull request #31 by adiroiban (2013-06-18 20:59:52+00:00)
Title: [#22] Update model when using multiple for input.

Problem description
---------------------------
When the model uses an array of objects, updating the model does not update the ui-select2 view.

Here is an example demonstrating the problem http://jsfiddle.net/hWXBv/25/

This is an attempt to fix #22

Changes
------------

I don't know much about angular and ui-select2 and JS in general, but I tried to help.

Also the documentation is sparse so I don't know how exactly ui-select2 should behave.

It looks like controler.render() does not detect chagnes when the model is an array of objects.

I have added a watch expression with 'deep' search so that watch function is called when model changes.

The fix is stupid since I did not want to do to much changes and break the other tests. Unfortunately the test suite is full of

Maybe the whole contoller.render could be implemented in the watch function.

How to test
----------------

There is a simple test to check the condition.

Please take a look at the model and suggest changes.