Tuesday 15 September 2015

controller - How best to wrap the Dynatree tree widget inside an Angular Directive? -


I understand the basic features of angular controllers and instructions, but I'm struggling to see how I Use the Dynatree tree widget.

The issue is that Dianyree is usually the means of retrieving the data through AJAX and it populates itself - and generally you can call it the "appendage" method. To add to the data, the tree node - that is, all its operations.

I know that I can separate the call to Ajax method and keep it in my tree controller controlling the outcome of the AJAX call - then in my instructions, changes in that parabagism Look for and then manually update the Dynatree widget. But the tree whose data I am dealing with is bigger and complex and it seems that the controller should be unable to maintain its own tree structure when Dynasty already has the structure of its tree.

My feeling is that in the case I really do not need a controller and instead I can just keep the directory wrapped inside the instruction and essentially always the way I always used it. I continue to use it, but it does not seem to work - and this is probably the knowledge about the instructions so I have some questions:

1] Is it Is it considered bad practice to call any type of AJAX call?

2] If so, do I like this 3rd party control which likes to do certain things? Do I really need to maintain my duplicate tree structure in my admin

3] If this Ajax call is deemed OK, how can I ensure in the director that Ajax method goes into the director? (I'm assuming that this is the cause of my problem)

If there is any help, here we are AngularJS instructions are used to wrap jquery dynatree.

Here (its a typecript, but you should get this idea, mostly Javascript).

No comments:

Post a Comment