Thanks for the advice Sander should give me a way forward

On Monday, 27 June 2016 05:28:52 UTC+1, Sander Elias wrote:
>
> Hi Robin,
>
> There are many ways to solve your issue. Roughly in NG1 there are 2 ways.  
>
> //main.js script file, defines your module
> angular.module('main', [])
>   .controller(...)
>
> //child.js script file
> angular.module('main') // notice no ,[] that means it just query's for 
> the module
>   .controller(...)
>
> You define 1 module, and then just reuse wherever you need it.
>
> //main.js script file, defines your module
> angular.module('main', ['child'])
>  .controller(...)
>
> //child.js script file
> angular.module('child',[])
>  .controller(...)
>
>
> Define a new module in every js file. The most important difference is 
> that the loading order of your script files becomes less of an issue in the 
> second case, and it makes a bit more explicit what your dependencies are. 
> For more n depth information, read through the styleguide 
> <https://github.com/johnpapa/angular-styleguide>.
>
> Regards
> Sander
>

-- 
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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to