When using ui-select multiple, I am facing an issue where I need to check the collection before ng-model="collection" is updated in order to ensure that the new value is not already present in it. Simply watching the collection does not solve this problem because the item is added first and then the $watch function gets called.
The on-select event also did not help in this scenario because the collection gets updated before I can check if the currently clicked item is already included in it before getting pushed.
Is there any way I can test this before the ng-model is updated?
The main purpose of this is to avoid adding duplicates to the collection.