What's a module in AngularJS?
A module is a container for different parts of your application i.e controllers,services,directives,filters,etc.
You can think the A module as a Main () method in the other types of applications.
How to create a module?
Use the Angular object's module () method to create a module.
var myApp = Angular.module ("MyModule", []); //
What's a controller in angular?
In angular a controller is a JavaScript function. The job of the controller is to build a model for the view to display.
How to create a controller in angular?
var function ($scope) { $scope. Message= "AngularJS Tutorial"; };
How do I register the controller with the module?
Myapp.controller ("Mycontroller", Mycontroller); // 1-Myapp.controller ("Mycontroller",function($scope) { // 2- $scope. message= "AngularJS Tutorial"; });
In JS file, we can add a reference with Angular.js to have some code tip. (AutoComplete some angular member.)
Part 2 Angular modules and controllers