I am attempting to troubleshoot why my select option value in my web app won't change after I load new data.
This is currently the select code in my web app:
<select ng-model="mySelect" ng-change="showSelectValue(mySelect)" ng-options="item.value as item.title for item in selectOptions" no-dirty-check=""> </select>
My controller processes the options with this code:
$scope.init = function() {
$scope.selectOptions = [
{value: "EndTimeSoonest", title: "Ending Soonest"},
{value: "StartTimeNewest", title: "Recently Added"},
{value: "PricePlusShippingHighest", title: "Highest Priced"},
{value: "PricePlusShippingLowest", title: "Lowest Priced"},
{value: "Completed", title: "Completed - Most Recent"},
{value: "CurrentPriceHighest", title: "Completed - Highest Price"}
];
};
$scope.init();
I am loading a series of data based of the user selecting items from the drop down menu. However, if they go to load a new search or new data, the last selected item in the select remains chosen, but the correct values are being passed.
Any ideas on how I can get the select to reset after a new search or loading new data?