vendredi 25 septembre 2015

Angular Tree Design: One single controller for whole tree, or one controller per tree node?

Newby AngularJS design question. When I say "controller" I am referring to all the usual components too, like directives, templates, and other things that usually go together.

Need to create a user "workspace" with folders and objects in each folder. Users can create/delete/rename folders and their child objects. There could be maybe 50 folders max but maybe 100 objects in each folder.

Naturally I want to implement a recursive controllers idea like mentioned for this question Is it possible to make a Tree View with Angular?

  • Would there be a performance issue with a recursive controller setup or would it be better to use one controller for the whole tree?
    • What is some good sample code using a single tree controller setup?
  • In general, does AngularJS handle recursive patterns well or is it an anti-pattern for ng?

Aucun commentaire:

Enregistrer un commentaire