2

In the code below,i am having a variable in controller named "selectedDesignAreaId" and i bind this variable with the current value of "designarea.id",but when i change "selectedDesignAreaId" to any of the value of designAreaId in repeater the class is not updated...Always 'unSelectedCanvas' is setted...

<div ng-repeat="designArea in productView.designAreas" style="position:absolute;left:{{designArea.x}}px ; top:{{designArea.y}}px;background-color: #ffdead"
                 ng-click="onDesignAreaClick(designArea.id)"
                 ng-class="{true: 'selectedCanvas', false:'unSelectedCanvas'}[(designArea.id == selectedDesignAreaId)]">
2
  • please set up plunker or jsfiddle demo Commented Apr 24, 2013 at 9:00
  • @Shivang sanghi please show ad demo of output. If you are not able to post images contribute to stackoverflow by answering peoples queries. For now show it through other means. Commented Apr 24, 2013 at 9:19

1 Answer 1

2

I tried to reproduce your issue, but it seems to be working for me: http://plnkr.co/edit/AuACV3SZRPgEqGBWpvkl

I hope you can identify the cause using this code.

You may want to make sure contents of selectedDesignAreaId and designArea.id and such. just putting {{ selectedDesignAreaId }} into your template would ease your debugging process. (IMO, it is even handier than using dev console.)

Sign up to request clarification or add additional context in comments.

2 Comments

thanks for your reply but its now working on my system...could i have your skype id so that i can show you my screen as well....
thank you so much..i was using different variable names in controller and template but your suggesstion "You may want to make sure contents of selectedDesignAreaId and designArea.id and such" really helps me...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.