I have two distinct arrays defined as :
var oldarr = ['one','two','three'];
var newarr = ['four','five','six'];
var condi = 1 / 0;
I am using the array values as ng-model options in a select dropdown. However, I want to dynamically switch between the arrays based on the value of the 'condi' variable. If 'condi' is 1, I will use ng-model = oldarr and if 'condi' is 2, I will use ng-model = newarr.
Below is my dropdown menu. Can someone please suggest how I can achieve this?
<select ng-model="oldarr " ng-selected="{{defaultvalue == selectedslastatus}}">
<option ng-repeat="vals in oldarr ">{{vals }}</option>
</select>