Hi, The issue is that by manually unchecking the checkbox, the checked attribute is set to false but selectedAll variable is still true. When you click master checkbox, selectedAll is set to true. This means that ng-checked attribute will not update the checkbox as selectedAll has not changed. You might want to use ng-model here and refrain from accessing dom in the controller. Update ng-model for each checkbox depending on the master checkbox.
I hope this helps. Regards, Vaibhav Gupta On Saturday, 30 April 2016 16:49:07 UTC+5:30, Abhinav Pandey wrote: > > Here is the Plunker <http://plnkr.co/edit/yVnuWp?p=preview> Preview of > the problem. > > See the *First Condition *in *app.js* It is not working as expected. > > I'm uploading images here for a better understanding of the problem. > > > <https://lh3.googleusercontent.com/-bLsvEqpk3Ok/VySUKxp2xkI/AAAAAAAAAqI/Up-bRiTt83Y30D2dM5PwPKiO3u7Qy8gcQCLcB/s1600/so2.png> > > > <https://lh3.googleusercontent.com/-KO3gKYGCblE/VySUOeTAPnI/AAAAAAAAAqM/Dctl8N7iw44NuqnvQ74VbyogndWmnI8PwCLcB/s1600/so1.png> > > Checkout the difference between first image and second image. After > unchecking any of the slave checkbox, the master checkbox is getting > unchecked but just after that when you click the master checkbox again(see > the second image) that particular salve checkbox is still unchecked. Why? > > What I'm doing here is wrong? How to make this code working as expected? > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
