search

Home  >  Q&A  >  body text

angular.js - ng-repeat for option tags.

The code is like this:

The page displays like this:

The console view element is like this:


One more loop.
What is the reason for this cycle?
Is there any good solution?
angular version 1.4.5

phpcn_u1582phpcn_u15822867 days ago609

reply all(3)I'll reply

  • 迷茫

    迷茫2017-05-15 16:59:39

    Solved it myself:
    Added:

    <option value="">选择</option>

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-15 16:59:39

    Why use ng-repeate when you can use ng-options. If you use ng-options, remember to write a default please select the item.

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-15 16:59:39

    When you get the data for the first time, can you display all the data?

    reply
    0
  • Cancelreply