Angular, doubt how to set checkbox

Asked

Viewed 84 times

1

Guys, I need a help, I have a checkbox that when selected activates a class in , so far it works, problem when I duplicate the tr, it activates the class for both at the same time.

I posted the link on jsfiddle, if anyone can help I appreciate!

https://jsfiddle.net/samucsouza/sgg5mhu7/2/

1 answer

1


So the reason you didn’t get the expected result is because your checkbox is in the same scope.

One way to solve it would be to isolate the scope of it. Therefore you will probably have an ng-repeat, so you can use the object itself to set the class.

For example: https://jsfiddle.net/sgg5mhu7/4/

  • Thanks Mario for the tip, it worked, thanks abs!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.