Removing option in a dropdown in angular

I want to remove an option in my when that option was already added.
Here is my code:

 1-$scope.loadIns.push(loadIn);
 2-var index = _.findIndex($scope.loadOuts,loadIn.product);
 3-$scope.loadOuts.splice(index,1);
 4-$scope.loadIn.product = $scope.loadOuts[0];

My problem here is that when I added the option will be removed first then the next option will be the one to be added. When I removed 2-4 line it will work fine


Source: New Questions

Leave a Reply