user160820
user160820

Reputation: 15200

How does AngularJS find and load modules

I m trying to understand the sample AngularJS app shipped with Packpub's book. the app.js file is defined under client/src/app folder and it's module definition looks like

angular.module('app', [
  'ngRoute',
  'projectsinfo',
  'dashboard',
  'projects',
  'admin',
  'services.breadcrumbs',
  'services.i18nNotifications',
  'services.httpRequestTracker',
  'security',
  'directives.crud',
  'templates.app',
  'templates.common']);

My question is how AngularJs will find these modules and uses in app?

Upvotes: 5

Views: 779

Answers (1)

thomaux
thomaux

Reputation: 19718

All those modules need to be loaded in your browser as well. AngularJS does not provide a module loader such as RequireJS.

You can either add <script> tags in the index file or concatenate all your sources into one big file. Some of the modules can be from AngularJS (such as the ngRoute). These will always be available in Angular, you do not need to load the sources in separately.

Upvotes: 3

Related Questions