A module can be defined by simply calling the angular.module function, where angular is a global namespace exposed by AngularJS and always available to us. The angular.module function accepts two parameters: the name of the module and an array of dependencies on other modules.
The angular.module returns a module instance and we can define a controller directly on that instance through the controller function.
In the example we define a mainModule module and a simpleController controller. We need to specify in the HTML template what's the main module of our application and we can do that with the ng-app directive. Our controller is then available as well in the HTML template.