An AngularJS module is a container for different parts of an
application, such as controllers, services,
filters, directives, and more. It helps in organizing the application into cohesive blocks of functionality. Modules provide a namespace for your application, and they can be used to load different parts of your application in a controlled way.
Syntax
var app = angular.module('myApp', [dependencies]);
Example-
var app = angular.module('myApp', []);
Adding Components to a Module
After creating a module, you can add components to it, such as controllers, services, directives, filters, etc.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
An AngularJS module is a container for different parts of an application, such as controllers, services, filters, directives, and more. It helps in organizing the application into cohesive blocks of functionality. Modules provide a namespace for your application, and they can be used to load different parts of your application in a controlled way.
Syntax
Example-
Adding Components to a Module
After creating a module, you can add components to it, such as controllers, services, directives, filters, etc.
Adding a Controller
Adding Service
Adding Factory
Features and Benefits of AngularJS Modules