Bindings Not Reflected

17 views
Skip to first unread message

Chaitanya Babar

unread,
Jul 23, 2017, 4:41:16 AM7/23/17
to Angular and AngularJS discussion
Hi All,

I am facing the following issue . I am adding & removing the elements in two Arrays by using .splice() & . push()  e.g . leftArray & rightArray ,inside the 
component . The leftArray & rightArray are passed to component using one way bindings . When I push element from one array into another , instead of showing value it shows the binding expression {{ leftArray.item}} or {{rightArray.item}} . But when i inspect that element i still find the value present there. This problem occurs in IE 10 & above .
For list to display i have used select html tag ( multi select is enabled ) . What I understand is the $digest is not called ? Can you please guide me or describe what may be the reason for the issue .


Thanks,
Chaitanya 

Sander Elias

unread,
Jul 24, 2017, 1:47:31 AM7/24/17
to Angular and AngularJS discussion
Hi Chaitanya,

Usually this only happens if you do this in a way that's not 'seen' by AngularJs's change-detection. Its very hard to tell without seeing your code. Probably you need a $scope.$evalAsync() in there somewhere.

Regards
Sander

Chaitanya Babar

unread,
Jul 25, 2017, 1:50:35 PM7/25/17
to Angular and AngularJS discussion
Hi Sander,

Thanks for the help .I switched from using ng-repeat to ng-options & it worked properly in IE . Now i cannot use ng-class with the ng-options . I tried using directive writing on ng-options but it did not helped . Can you suggest any approach to use ng-class with ng-options . If not ng-class how can we add class to element in list depending upon certain value.


Thanks,
Chaitanya

Sander Elias

unread,
Jul 25, 2017, 9:27:36 PM7/25/17
to Angular and AngularJS discussion
Hi Chaitanya,

As I'm unsure of what it is that you want to accomplish, or why you want to single out some of your options, there is little I can do to help you. Using ngOptions means that you don't have (direct) access to the option nodes in the select anymore, so styling them on their content is not an easy task. Can be done, but it's not easy, and surely not pretty ;)

Regards
Sander
Reply all
Reply to author
Forward
0 new messages