AngularJS Tutorial 6 - Modules

preview_player
Показать описание
In this video we are going to cover Modules in angularJS.
Modules are one of the most important part of any angularJS application. Modules act like a container for different parts of your application like routes, controller, filters,directives,services etc.

How to create Module

Creating module is quiet easy and straight forward. So to create module you need to use angular object's module method.
module method takes two parameter- first parameter is the name of the module and second the list of dependencies.
Module may have dependency on another modules, so you need to pass all module names in second parameter on which your main module is dependent.
If you module is not dependent on any other modules , you need to pass empty array in 2nd parameter of module() method.

How to use module in shell page

Now to refer your "mainApp" module in shell page so that all the associated controllers,filters,directives can load as soon as your angular will load you need to use this module in ng-app directive

ng-app = "mainApp"

Further in the coming videos we will bind controllers on this module

To visit all my videos on angularJS Please visit this link:

Рекомендации по теме
Комментарии
Автор

great AJS tutorials which i find recently.
The best thing in your videos are your voice is clear and informatic way to reach the beginers.

hope to waiting for more videos on AJS.

adhelaxmi