search

Home  >  Q&A  >  body text

angular.js - AngularJs ng-option how to remove the default item

<select ng-model="et.edate" ng-options="et.edate as et.edate for et in endTimeArr" ng-change="getET(et.edate)" class="ng-pristine ng-untouched ng-valid">

<option value="?" selected="selected"></option>

<option value="string:2016-07-07 21:00" label="2016-07-07 21:00">2016-07-021:00</option>            

<option value="string:2016-07-07 21:30" label="2016-07-07 21:30">2016-07-07 21:30</option>

</select>

Excuse me<option value="?" selected="selected"></option> How did this come out and how to remove it?

PHPzPHPz2782 days ago543

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-05-15 17:05:40

    http://jsfiddle.net/MTfRD/3/

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-15 17:05:40

    Hacking with Angular: Playing with the ngOptions directive can help you.

    reply
    0
  • PHP中文网

    PHP中文网2017-05-15 17:05:40

    The simplest and most effective is: assign a default valueet.edate to

    in the controller

    reply
    0
  • Cancelreply