When, in my controller, I set $scope.object.attribute = "value1", instead of setting the select value with "value1" it creates a new option: <optionvalue="? string:value1 ?"></option>
Does anyone know why is that happening?
p.s.: I made a simple example on jsfidle but then it worked as expected. I mean, it didn't give me the problematic behaviour.
Message has been deleted
José Rodolfo Freitas
unread,
Feb 16, 2013, 10:25:15 AM2/16/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
I just found out what might be the problem instead of static option tags I have a ng-repeat:
<option value="{{value}}" ng-repeat="value in values">{{value}}</option>
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
Thanks Marcin, using ngOptions really worked! However, I wanted to have two default options, not only one as ngOption documentation suggests. something like: <option value="">Default option</option> <option ng-repeat>value in values</option> <option>create new value</option> (in case the required value was not found on collection).
Any workaround for that?
Clint Checketts
unread,
Feb 16, 2013, 12:47:58 PM2/16/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message