Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

I'm new at Angular JS and I'm having some problems with it. I'm trying to use this module: http://ngmodules.org/modules/angular.treeview but it's not recognizing the Angular code. You can see my plunker here: http://plnkr.co/edit/xigaA37RieS70CwcK834?p=preview

I wish to know where is the error and I also have a question: if I want to use other modules/plugins and stuff like these, how should I code it? I mean, I would have another .js like:

(function(){  
   angular.module('myApp').controller('CONTROLLER_NAME', function($scope){
   ...
   }
}

and I should retrieve it on app.js by doing:

var myApp = angular.module('myApp', ['angularTreeview','CONTROLLER_NAME']);

Tell me if I missed something..

Thanks in advance,

Lucas.

share|improve this question
    
your script loading order is incorrect, need to load modules right after angular.js, can't inject something that hasn't been loaded yet. Also using old version of angular in demo – charlietfl Nov 14 '13 at 13:02
    
I changed the order and updated Angular... Still the same problem – lucasdc Nov 14 '13 at 13:12
    
myApp should only show up once in module('myApp') then when add directive/controolers use myApp.controler. Reorganize demo, can use gitHub source for treeview script snd css. Put all the code in one place with script order corrected – charlietfl Nov 14 '13 at 13:16
    
right now you have controller being declared before module...organization is messy – charlietfl Nov 14 '13 at 13:18
    
Alright.. it worked! It was really the order: I just put "main.js" before "tree.js" and the tree showed up. Could you answer my second question? I mean.. actually idk where do I get the dependencies' name from... that angularTreeview comes from (function(l){l.module("angularTreeview",[]) on tree.js? Thank you very much! – lucasdc Nov 14 '13 at 13:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.