Hello, angular community!
My question is the following:
Can anyone help me how to pre select an element inside a select tag with
'ng-options'?.
For example, assume in my controller I have the following:
*// inside controller*
*$scope.people = [{'name':'joe', 'age': 24}, {'name':'anna', 'age': 22},
{'name':'sam', 'age': 38}];*
*// end*
*// in my view *
*<select ng-model="selectedPerson" ng-options="person.name for person in
people"></select>*
*// end*
How would I *pre select 'selectedPerson*' to be say, the last person (sam)?
Thanks in advance
--
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 http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.