I have a question related to modules and routing in angularjs. The 
requirements are to define all routing configs in one module - lets call 
this ModuleRtr.

Once the route is triggered, it should call a controller (called TestCtr 
for example). This controller is defined in another module - let's call it 
ModuleCtrl.

If I try to do that, I got an exception like:

"Argument TestCtr is not a function, got undefined" .The reason is that 
when angular broadcast $routeChangeSuccess event, the listener tries to 
access the controller (TestCtr) as part of the current module - ModuleRtr. 
Because it's not there, it throws an error.

If I simply create TestCtr controller in ModuleRtr (the same that has the 
route in it), then everything works. But I don't want that, I want to have 
my TestCtr in different module. I also don't want to have route define in 
ModuleCtrl module.

So, in more straightforward way, my question is: Is it possible a route 
defined in one module (ModuleRtr) to call a controller defined in another 
module (ModuleCtrl)?

Something that I forgot to mention...I don't want to bind these 2 modules 
by any means. That of course includes listing a dependency during module's 
creation. I have already tried dynamic loading of TestCtr - it didn't solve 
the problem.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to