Arrays
AngularJS arrays are like JavaScript arrays.Example: AngularJS arrays
<!DOCTYPE html/>
<html ng-app>
<head>
<script src="Scripts/angular.min.js" type="text/javascript"></script>
</head>
<body>
<div ng-app="" ng-init="points=[10,15,19,2,4]">
<p>The third item in the array is = {{points[2]}}</p>
</div>
</body>
</html>
Output:
The third item in the array is = 19
Module in AngularJS
- Module is a container for different part of your container. It can contain controllers, services, directives, filters etc.
- You can consider a module as a main() method, same as in C# or in Java.
- Angular apps don't have a main method, instead modules declaratively specify how an application should be load for execution.
- Declarative process for creating the module is easier to understand.
- Modules are reusable.
- The modules can be loaded in any order.
- Modules are fast with respect to unit tests because it loads relevant modules only.
var app = angular.module("myModule", [ ]);
According to the above code, it will create module name "myModule" and it will not dependent on any external module due to second parameter as an empty array.


