angularjs - angular slow select input -


in controller, set 2 scope variables "otherscope" , "options".

otherscope: {"id":"1", "val1":"x", "val2":"y", ...} 

othersope.id value, should selected one. contains 1 object

options: [{"id":"1", "text":"sometext"}, {"id":"2":"sometext2"}, ...] 

options.id available options compare otherscope.id. contains 50 objects.

it works, take 10 seconds render. correct way set selected value?

<label class="item item-input item-select">             <div class="input-label">               options             </div>             <select ng-model="otherscope.id">               <option ng-repeat="option in options track option.id" value="{{option.id}}">{{option.text}}</option>             </select>           </label> 

change options option in ng-repeat

<option ng-repeat="options in options track option.id" value="{{option.id}}">{{option.text}}</option> 

should be:

<option ng-repeat="option in options track option.id" value="{{option.id}}">{{option.text}}</option> 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -