ordering by multiple fields, and changing this via a select menu

2,152 views
Skip to first unread message

Daniel Nelson

unread,
Jul 19, 2012, 5:08:53 PM7/19/12
to ang...@googlegroups.com
I want to sort a list based on more than one criterion, and I want to
change this criterion based on a select menu, but am unsure of how to
do this. For example:
http://jsfiddle.net/mACJQ/

I presume the problem is that the options in a select menu are
interpreted as strings. Is there a way to make Angular interpret those
as arrays when it receives them?

Thank You,

Daniel

Daniel Nelson

unread,
Jul 19, 2012, 5:26:16 PM7/19/12
to ang...@googlegroups.com
On Thu, Jul 19, 2012 at 4:17 PM, Andy Joslin <andyt...@gmail.com> wrote:
> Er, the above without the strings^.
>
> http://jsfiddle.net/mACJQ/
>
> It's giving an error though, but you should switch away from using
> angular.min.js so you get a real error.

Angular doesn't appear to like brackets in the ng-repeat:
http://jsfiddle.net/646tA/

Daniel Nelson

unread,
Jul 19, 2012, 11:13:47 PM7/19/12
to ang...@googlegroups.com
> It didn't like your options: http://jsfiddle.net/646tA/1

Sweet! I knew that it was viewing the options as strings, but I didn't
know how to populate it with real arrays. Thank you for showing the
way to do that.

Best,

Daniel
Reply all
Reply to author
Forward
0 new messages