wix-incubator / angular-tree-control

Angular JS Tree
http://wix.github.io/angular-tree-control
MIT License
708 stars 276 forks source link

Way to bind data from parent scope to element in node? #147

Open AdityaAgg opened 9 years ago

AdityaAgg commented 9 years ago

I am trying to bind data from the parent scope to an element I have made in the template for each node. However, the node's isolated scope makes it difficult to pass down this information. I have added an attribute through the isolated scope definition (scope: {filedata: "="}) and set filedata in my html. Nonetheless, when I used ng-model="filedata" the data does not change (or it may be that I can't view the change). A watch trigger from another application (ng-file-upload) is supposed to go off and call an upload file function when I change the main (not the isolated) scope data from the client, and that does not happen. I suspect because ng-model is having trouble due the isolated scope. Could also be that the watch function does not include the isolated scope (but if the data is correctly binded from the parent scope the watch function should be triggered because the parent scope property changes). The use case for this is adding drag and drop functionality to angular-tree-control. I can add further explanation or clarification if this is not enough.

yoavaa commented 9 years ago

Can you provide an example? have you tried following the guidelines in the docs?