I understand that ng-app initializes a module in AngularJS as follows:
var app = angular.module(\'myApp\', []);
B
ng-app
defines the main
or bootstrap
module of your application, which should perform the initialization task of your application. There may be case where at run time you want to decide what which should be the main module of your application. Like in java you have many methods and classes but you define one main
method as starting point. Similarly, in angular you have many module, however, you define one module as the starting point of application.