AngularJs Modules

AngularJS Modules

You might now be wondering, what are modules ?

Let us discuss about modules and their relevance, before seeing more about controllers.

Modules in AngularJS:

  • AngularJS follows the module pattern.
  • It segregates our application code into the reusable components.
  • This helps to package the complete application code into reusable modules, like we do packaging of server side code.
  • It makes development, maintenance and testing of Angular application easier.
  • Every module should ideally be in its own js file. Ideally, the file name should match with module name.

For Example :

  • Name of Angular Module: app
  • Name of js file where the module is defined: app.js

Let us see now look into how modules can be created in AngularJS.

The method angular.module() is used to create a module in AngularJS, as shown below.

AngularJS-Modules
#AngularJS_Modules #Angular_Modules #Modules_in_AngularJS #Modules_in_Angular #angular_create_module #angular_routing_module #angular_http_module #angular_module_example

(New page will open, for Comment)

Not yet commented...