php - AngularJS - Dropdown Select Values are not in Order with ng-repeat -


I have a select drop down with the following data; (This is also the output of the console in Chrome).

  {8: "something", 9: "something again!", 10: "and then", 11: "and then!", 12: "etc ..." 13: "etc etc ...",}  

HTML and angle for selection drop down;

  & lt; Select name = "name" ng-model = "selected" & gt; & Lt; Option value = "" & gt; Please select & lt; / Select & gt; & Lt; Option ng-repeat = "data (key, value)" value = "[[key]]" & gt; [[Price]] << / Option & gt; & Lt; / Select & gt;  

The following list is obtained from the list of functions within Laravel (4.2);

  Model :: lists ('name', 'id');  

For any reason the data is changed again in my drop down;

  & lt; Name name name = "name" ng-model = "selected" & gt; & Lt; Option value = "" & gt; Please select & lt; / Select & gt; & Lt; Option value = "10" & gt; And then & lt; / Options & gt; & Lt; Option value = "11" & gt; and then! & Lt; / Options & gt; & Lt; Option value = "12" & gt; Etc ... & lt; / Options & gt; & Lt; Option value = "13" & gt; Etc etc ... & lt; / Options & gt; & Lt; Option value = "8" & gt; Some & lt; / Options & gt; & Lt; Option value = "9" & gt; anything else! & Lt; / Option & gt; & Lt; / Select & gt;  

How can I create output from ng-repeat through the sequence of data in correct numerical order?

similarly;

  & lt; Select name = "name" ng-model = "selected"> & Lt; Option value = "" & gt; Please select & lt; / Select & gt; & Lt; Option value = "8" & gt; Some & lt; / Options & gt; & Lt; Option value = "9" & gt; anything else! & Lt; / Option & gt; & Lt; Option value = "10" & gt; And then & lt; / Options & gt; & Lt; Option value = "11" & gt; and then! & Lt; / Options & gt; & Lt; Option value = "12" & gt; Etc ... & lt; / Options & gt; & Lt; Option value = "13" & gt; Etc etc ... & lt; / Options & gt; & Lt; / Select & gt;  

is plunker

It seems that data by NGERPT Sorts $ $ hash, possibly using a function that lists the keys and then iterates over them:

  $ scope.keys = function (obj) {obj ? Object. Key (oboj): []; }  


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -