| 1. |
What is an AngularJS module? |
|
Answer» An AngularJS module is nothing but a container for maintaining different components of the AngularJS application such as controller, filters, directives, services, etc, and a place where dependencies between them are defined. It can be treated like a main() method of Java. AngularJS module can be CREATED by making USE of the module() method of the ANGULAR object. To the app module, we can define all the controllers, filters, constants or directives, etc as shown in the FIGURE: For example, to define a controller, we follow the below approach: app.controller("FirstController", ['$scope', function(obj) { obj.item = "Item 1";}]); |
|