-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tree Instance undefined in controller #8
Comments
Hi, I am using the tree instance in another project that i developed using the ngJsTree. Can you write a plunker with code example? |
Are you using the controllerAs syntax? looks like there is bug the makes it not work with controllerAs. |
Fixed in 0.0.3 |
Hello, i made a simple example in plunker(http://plnkr.co/edit/VPyWFvQi8mKz9PoGjxmo?p=preview) please check the treeInstance console.log in treeCtrl.js is undefined. |
Are you using the new version? |
The treeInstance will not be ready on the controller in this stage, it will be ready only after the contoller is created and the tree is created. when you print to the log the tree is not yet created, this is why you see undefined |
I forked your plunker and fixed it, take a look here http://plnkr.co/edit/1PHjOqojZsVlQmP819PW?p=preview |
Thanks for your help. |
In your example "Using the Js Tree API from your controller" you say that i need only to use tree attribute and if i go to my controller i can call a method of Js Tree but the treeInstance is undefined. I saw your demo but there is no use of this attribute in the treeCtr.js. Any suggestions to make it work because i couldn't even in your demo.
thanks
The text was updated successfully, but these errors were encountered: