I have options array for select dropdown like
[
{key:1,value'foo',selected:true},
{key:2,value'foo2',selected:false}
]
I want to select option value with the property selected true in my model. So for this option array of my model should be initialized and bind to 1.
Any help is appreciated!! Thanks in advance :)
For this i know i can do it by looping in controller and setting the value whose property selected is true. I am looking for an alternative which is better. Also i have tried ng-repeat on options and it works, but i think ngOptions is better from the view of performance.
If I understood the requirements correctly: