Here is an example of HTML code using ui-select
:
<ui-select ng-model="actionSelectedId"
on-select="changedAction($item, $select, row)"
theme="bootstrap"
ng-disabled="disabled">
<ui-select-match placeholder="Select an action">
<span>{{$select.selected.name || $select.search}}</span>
</ui-select-match>
<ui-select-choices repeat="action.id as action in actions | filter: $select.search">
<span ng-bind-html="action.name | highlight: $select.search"></span>
</ui-select-choices>
</ui-select>
In order to retrieve the previously selected action id in the changedAction
method within the controller, you can pass the oldSelection
parameter like this:
To call the method with the previous selection included:
on-select="changedAction($item, $select, row, oldSelection)"
If you have any insights on how to achieve this using ui-select, please share. Thank you!