Hey guys, just upgraded to rc6. 

////// in my HTML -->

<select [(ngModel)]= "options" (input)="onInput($event)">
          <option *ngFor = "let option of options" [value]="option.id" 
[selected] = "option">{{option.name}}</option>
       </select>

/////// in my TS file,  i am handling the value selected from the dropdown 
as follows :
options = [
    {id: 1, name: 'Popularity'},
    {id: 2, name: 'A - Z'},
    {id: 3, name: 'Z - A'}
    ];

onInput($event) {
    //$event.preventDefault();
    alert('selected: ' + $event.target.value);
  }

which is working perfectly, now I would like to set the default value of 
the dropdown as the  first value in the array, any suggestions ?!..

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to