checkboxes to replace <select multiple>

980 views
Skip to first unread message

s.teu...@gmail.com

unread,
Nov 5, 2012, 9:44:08 AM11/5/12
to ang...@googlegroups.com
Hi all,

I am looking for an alternative for the  <select multiple> element which I think is not really user friendly.
I am thinking of creating a directive which ng-repeats over a collection (the selectables) and creates checkboxes for all of these.
After this I bind to the change event and depending on true or false I add or remove the checked element to or from the "selected" collection.

But I feel there must be a better way. (Especially as I also want two way binding of the "selected" collection).

Anyone any suggestions?

Sander.

Kai Groner

unread,
Nov 8, 2012, 9:00:47 AM11/8/12
to ang...@googlegroups.com
Hi Sander,

I created directives to do this.  They work, but sometimes I think it makes more sense to just transform my data for angular when I load/save it.


Code:

Original discussion:



Kai




--
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.
 
 

Ryan Randall

unread,
Nov 8, 2012, 10:09:08 AM11/8/12
to ang...@googlegroups.com, s.teu...@gmail.com
Hi Sander,

Here are a few directives I've written recently which may be of use/interest...


I'd be interested if anyone can see any ways these can be improved.

Cheers!
Ryan

Peter Bacon Darwin

unread,
Nov 8, 2012, 11:24:17 AM11/8/12
to ang...@googlegroups.com
Nice stuff Ryan!

--

s.teu...@gmail.com

unread,
Nov 8, 2012, 2:22:51 PM11/8/12
to ang...@googlegroups.com, s.teu...@gmail.com
Thanks all ! going to dig in ;-)
Reply all
Reply to author
Forward
0 new messages