You do not have permission to delete messages in this group
Copy link
Report message
Sign in to 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 AngularJS
I have a {{bgColour}} which is linked to ng-model="bgColour". I want to assign a #colourValue ( say #fff or #000 etc) to {{bgColour}} when an image ( say in colour RED ) in a popup modal. The idea is to change colours in a theme when clicked on the colour palette ( just a bunch of images with corresponding colour ). bgColour is the theme colour which I am trying to change. Trying to use ng-click=" an expression to insert corresponding hex colour value for bgColour " to change the colour. But I do not know the expression that could be used to insert various hex colour values when different images are clicked. Any help would be great.
Sander Elias
unread,
Jul 25, 2016, 11:49:14 PM7/25/16
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
Sign in to 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 AngularJS
Hi Team,
This is the simplest solution I could come up with:
<inputtype="color"ng-model="vm.bgcolor"> <divng-style="{'background-color':vm.bgcolor}"> Sample area <br> {{vm.bgcolor | json:true}} <br> </div>
Does that help your use-case?
Regards Sander
Team AF
unread,
Jul 26, 2016, 4:17:16 AM7/26/16
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
Sign in to 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 AngularJS
Awesome ! Works great. My primary requirement is to bind the colour change to a CSS class. How can I accommodate with this code ?
Newen F
unread,
Jul 26, 2016, 6:44:29 AM7/26/16
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
Sign in to 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 AngularJS
you would make 2 classes. like the two different states. and just add the class when you wan to change state. right?
<div [class.className]='conditional' ></div>
I think.
Team AF
unread,
Jul 26, 2016, 9:11:30 AM7/26/16
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
Sign in to 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