Toggle Button with 2 colors and 2 glyphs custom directive?

110 views
Skip to first unread message

Andre Venter

unread,
Jan 13, 2014, 9:21:36 AM1/13/14
to ang...@googlegroups.com
We can't be the first noobs on the block who want to make custom buttons toggle in AngularJS

Link to our progress: http://jsbin.com/EHIrUrIQ/2/edit

What we expect to happen:
We hope we can click on the special button and it will toggle 3 things:
  1. a value in $scope
  2. its color
  3. its image of glyph
What we looked at for inspiration:

http://mgcrea.github.io/angular-strap/#/#selects -- it does not even have a directive.
Calendar and time toggle buttons that change something else than them selves.

We have just started using Angular and were hoping we could make a simple custom toggle button without having to understand directives completely.

I really hope someone has done this kinda thing before. The app we have to build is full of toggle buttons like this.

Sander Elias

unread,
Jan 13, 2014, 9:50:39 AM1/13/14
to ang...@googlegroups.com
Hi Andre,

there where some problems with your bin. here is my version: http://jsbin.com/AQOCEHer/1/edit
Here is a version that works. Have a look at what I did, and then question me about it if you don't get the why!

Regards
Sander

Andre Venter

unread,
Jan 13, 2014, 9:53:25 AM1/13/14
to ang...@googlegroups.com
WOW Sander !!!

That is exactly what we where trying to do. Let me see how you did that.

Thank you so much for helping me :)


--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/_OPxTsOPtR8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages