mardi 17 janvier 2017

Designing and implementing check-all functionality with custom directives

  1. I've got a grid.
  2. In each row there's a custom checkbox directive(d1).
  3. I've got another custom checkbox directive(d2) which I would like to have the ability to check or uncheck all the other checkboxes in the grid.
  4. Also, when all the d1 directives are checked manually in the grid, d2 should also be checked.
  5. And if I click on d2 then uncheck any of the d1s in a row, d2 should be unchecked.
  6. The checkboxes are images binded to a real checkbox which is hidden.




I don't want to 'require' d2 in d1 because it doesn't make sense in my project.
I don't want to use jQuery either.

So I guess I should use service/factory.

What's the most acceptable way to design and implement this functionality?




Aucun commentaire:

Enregistrer un commentaire