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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With