Question:What are Modules in AngularJS? 

Answer AngularJS modules are containers just like namespace in C#. They divide an angular app into small, reusable and functional components which can be integrated with other angular app. Each module is identified by a unique name and can be dependent on other modules. In AngularJS, every web page (view) can have a single module assigned to it via ng-app directive. Creating an AngularJS module
<script type="text/javascript">
//defining module 
angular.module('myApp', []); 
//OR defining module which has dependency on other modules 
angular.module('myApp', ['dependentModule1', 'dependentModule2']); 
</script>
Using an AngularJS module into your app You can bootstrap your app by using your AngularJS module as given below:
<html ng-app="myApp"> 
<head> ... </head>
<body> ... </body>
</html>
 

+ Report
Total Preview: 1255
What are Modules in AngularJS?
Copyright © 2024. Powered by Intellect Software Ltd
 Using an AngularJS module into your app You can bootstrap your app by using your AngularJS module as given below:  ... ...   ","http://vcampusbd.com/answers/19106/what-are-modules-in-angularjs","http://vcampusbd.com/images/vcampus_quiz.jpg","AngularJS"); }); });