Vishal Gandotra
Vishal Gandotra

Reputation: 1

How to populate dropdown with its previous value?

We have a dropdown which had 3 values, out of which one value is removed now, so two values are left for the user to select now. But if the user searches an item which has that value in the dropdown which we deleted. So, on the initial load of page, the dropdown must show the third value as SELECTED, but if the user expands the dropdown, it should show only the two values not the third values

We are using "oi-select" element to populate the dropdown and i tried using "ng-show" property but it did not work

Upvotes: 0

Views: 59

Answers (1)

Volkan Talayhan
Volkan Talayhan

Reputation: 36

I am not familiar with oi-select but after selectedValue is filled. you could check if selectedValue is available in selectionlist. *if not you can push selectedValue into selectionlist array. *or if you loop selectionlist through oi-option, you can add a second oi-option under looped one. and implement same logic with ng-if to that last oi-option

Upvotes: 0

Related Questions