What is manual bootstrap process in AngularJS or How AngularJS is initialized manually

You can manually initialized your angular app by using angular.bootstrap() function. This function takes the modules as parameters and should be called within angular.element(document).ready() function. The angular.element(document).ready() is an event that is fired when the DOM is ready for manipulation

<html>
   <body>
      <div ng-controller="Ctrl">
         Hello {{msg}}!
      </div>
    <script src="lib/angular.js"></script>
    <script>
       var app = angular.module('myApp', []);
       app.controller('Ctrl', function ($scope) {
          $scope.msg = 'World';
       });       
       angular.element(document).ready(function () {
          angular.bootstrap(document, ['myApp']);
       });
    </script>
   </body>
</html>

results matching ""

    No results matching ""