Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

How to set selected option in select

Hi,

Code: Select all

In the Pizza example, I set the select and its options like this: 

Select Options and set its property ng-model = "selected.item" and set ng-options to the value "item.name for item in list".

How can I set a specific option (let's say, the second) to be selected when I open the page? Should I use ng-selected? How?

Code: Select all

 Thanks
Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

How to set selected option in select

Hello,

Please set the value of the variable "selected.item" = second item if the array "list" for that

Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

How to set selected option in select

Thank you, Sergiy, it worked!

Return to “Issues”