Personally, I would suggest putting the definition of the /lead route in the LeadLookup module. If you're going to modularize, don't do it by half steps. This is what I do, so that way you can put the /module routes, tests, controllers and so forth all in the same directory and all you have to do is (a) include them in the compiled javascript and (b) declare LeadLookup as a dependency on your top-level app.
e On Sun Nov 30 2014 at 1:51:15 AM <[email protected]> wrote: > Hi, > > I'm new to angular and I'm trying to modularlize my app. > > My main module gets some other module and I want to use the controller of > the injected module in my route definition. > Some simple example would be very helpful! > > var app = angular.module('Contacting_App', ['LeadLookup']); > > app.config(['$routeProvider', function($routeProvider) { > $routeProvider. > when('/main', > {controller: 'MainCtrl', > templateUrl: 'apex/f42_Contacting_Main'} > ). > when('/lead', > {module: 'LeadLookup', > controller: 'LeadLkpCtrl', > templateUrl: 'apex/f42_Lead_Lookup'} > ). > otherwise( > {redirectTo: '/main'} > ); > }]); > > > -- > 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/d/optout. > -- 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/d/optout.
