In my angular application, I have a code snippet that generates a navigation tree within a <div>
. The size of this tree depends on the contents of mymodule.tree.folders
. To enhance this functionality, I want to create a directive named class="scrollable"
, which will integrate the features of jquery.nicescroll into the surrounding <div>
:
<div class="scrollable">
... the dynamically resizing tree goes here ...
</div>
To ensure proper functioning of the library even after changes in the content size, I need to call the resize()
function of nicescroll whenever the model mymodule.tree.folders
is updated. My query is: How can I incorporate the array mymodule.tree.folders
into my directive for monitoring using $watch()
? I wish to include it like so:
<div class="scrollable" scrollable-watch="mymodule.tree.folders">
... the dynamic tree content goes here ...
</div>
Is it possible to directly access this model from the template's scope, or do I need to store the entire tree data separately?