The array passed into angular.module lists the app's *dependencies*.

Those *dependencies* need to be found in the *scripts* loaded in your app 
(typically *index.html*)

In fact, the line you specified, angular.module('app', [ ... ]) *also*needs to 
be found in a script.

...more specifically how this all will be loaded.

The browser is responsible for loading the scripts and executing them in 
its javascript engine.

You need to tell the browser where to find the scripts. For example, you 
would probably have you scripts listed something like this in your 
*index.html:*

<html>
   ...
    <body>
        ...

        <script src="http://code.angularjs.org/1.2.10/angular.js";></script> 
        <!-- contains angular core - needs to be listed first -->
        <script
 src="http://code.angularjs.org/1.2.10/angular-route.js";></script>   <!-- 
contains angular ngRoute -->
        ...
        <script src="scripts/app.js"></script>                             
         <!-- contains angular.module('app', [ ... ]); -->
        <script src="scripts/controllers/projectsinfo.js"></script>         
        <!-- contains projectsinfo -->
        <script src="scripts/services/breadcrumbs.js"></script>             
        <!-- contains services.breadcrumbs -->
    </body>
<html>

When the browser sees the script tag it downloads the script and passes it 
through its javascript engine.

Scripts are loaded sequentially, so therefore the order of declaration is 
important.

The *angular core* script needs to be listed before anything which 
references angular. This is because it contains the angular.module etc 
definitions which your controllers, services etc will use.

Try putting the angular.js core script last and reloading your page. It 
won't render. Look at the browser's javascript console - you will see that 
your modules fail to load because they don't know what 'angular' is.

-- 
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