Module defines an application.
Modules are containers for different parts of your application.
Modules are containers for application controllers.
Controllers usually belong to a module.
AngularJS modules syntax
You can create modules through the angular.module function of AngularJS
AngularJS modules example
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="https://cdn.bootcss.com/angular.js/1.4.6/angular.min.js"></script> </head> <body> <div ng-app="myApp" ng-controller="myCtrl"> {{ firstName + " " + lastName }} </div> <script> var app = angular.module("myApp", []); app.controller("myCtrl", function($scope) { $scope.firstName = "John"; $scope.lastName = "Doe"; }); </script> </body> </html>
Run instance »
Click the "Run instance" button to view the online instance