What Is Auto Bootstrapping in Angular? - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
What Is Auto Bootstrapping in Angular?

What Is Auto Bootstrapping in Angular?

What Is Auto Bootstrapping in Angular?

Though Everyone above has answered perfectly and I found what I was looking for but still a working example seem missing.
While understanding about Auto / Manual bootstrapping in AngularJS below examples can help a lot :
AngularJS : Auto Bootstrapping :
Angular initializes / bootstraps automatically upon DOMContentLoaded event or when the angular.js script is downloaded to the browser and the document.readyState is set to complete. At this point AngularJS looks for the ng-app directive. When the ng-app directive is found then Angular will:
  1. Load the module associated with the directive.
  2. Create the application injector.
  3. Compile the DOM starting from the ng-app root element.
This process is called auto-bootstrapping.
<html>

    <body ng-app="myApp">
        <div ng-controller="Ctrl">Hello {{msg}}!</div>
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
        <script>
            var app = angular.module('myApp', []);
            app.controller('Ctrl', function($scope) {
                $scope.msg = 'Nik';
            });
        </script>
    </body>

</html>
An NgModule describes how the application parts fit together. Every application has at least one Angular module, the root module that you bootstrap to launch the application. By convention, it is usually called AppModule.

About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.