ngSwitch not working as expected

333 views
Skip to first unread message

J Castillo

unread,
Oct 3, 2012, 7:38:05 PM10/3/12
to ang...@googlegroups.com
here is my fiddle:


I'm trying to figure out what I'm doing wrong here. If I pass a JSON to the ngOptions then the ngSwitch doesn't work but if is an Array then it works fine, although it repeats the first option twice.

Try by selecting all the options in example one and then reselect the first option (settings) then you will see the message twice. Am surprise this works on the docs.angularjs.org site.

Any help would be very much appreciated.

Thanks!


J Castillo

unread,
Oct 3, 2012, 7:40:17 PM10/3/12
to ang...@googlegroups.com
sorry I had a typo, here is the updated one: 

Renan T. Fernandes

unread,
Oct 3, 2012, 7:43:44 PM10/3/12
to ang...@googlegroups.com
http://jsfiddle.net/8Ycet/1/ should be ng-switch on="selection2.name"given that you want to compare the name property of the object instead of the object itself

2012/10/3 J Castillo <jorg...@yahoo.com>
sorry I had a typo, here is the updated one: 

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en.
 
 



--
Renan Fernandes(aka "ShadowBelmolve")

J Castillo

unread,
Oct 3, 2012, 8:54:32 PM10/3/12
to ang...@googlegroups.com
Thank you Renan it was in front of me but I couldn't see it for the live of me.

Unfortunately I still have an issue on option one when you select it for the second time around. it looks like a bug in ngSwitch.
Reply all
Reply to author
Forward
0 new messages