• jQuery
  • Servlet
  • Java IO
  • Spring
  • JSP
  • PHP
  • JavaScript
  • Core Java
  • RubyonRails

  • <

    AngularJS Modules

    An AngularJS module defines an application.

    The module is a container for the different parts of an application.

    The module is a container for the application controllers.

    Controllers always belong to a module.

    A module is created by using the AngularJS function angular.module.

    AngularJS Modules Example



    
    
    <div ng-app="myApp">...</div>
    
    <script>
    
    var app = angular.module("myApp", []); 
    
    </script>
    


    Example



    
    <!DOCTYPE html>
    <html>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
    <body>
    
    <div ng-app="myApp" ng-controller="myCtrl">
    {{ firstName + " " + lastName }}
    </div>
    
    <script>
    var app = angular.module("myApp", []);
    app.controller("myCtrl", function($scope) {
        $scope.firstName = "java";
        $scope.lastName = "meant";
    });
    </script>
    
    </body>
    </html>
    
    
    
















    © copyright 2017-2021 Completedone pvt ltd.