Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • AngularJS Tutorial
  • AngularJS Directives
  • AngularJS Functions
  • AngularJS Filters
  • AngularJS Examples
  • AngularJS Interview Questions
  • Angular ngx Bootstrap
  • AngularJS Cheat Sheet
  • AngularJS PrimeNG
  • JavaScript
  • Web Technology
Open In App
Next Article:
AngularJS angular.toJson() Function
Next article icon

AngularJS angular.bootstrap() Function

Last Updated : 06 Sep, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

The angular.bootstrap() Function in AngularJS is a functional component in the Core ng module which is used to start up an Angular application manually, it provides more control over the initialization of the application. 

Syntax:

angular.bootstrap(element, [modules], [config]);

Parameter Values:

  • element: An element is a DOM element (e.g. document) that is the root of the Angular application.
  • Modules: (Optional)Modules are an array of modules to be loaded.
  • Config: (Optional)Config is an object used for configuration options.

Example 1: This example describes the usage of the angular.bootstrap() Function in AngularJS.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>angular.bootstrap() Function</title>
    <script src=
"https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js">
    </script>
    <style>
        .id {
            font-size: 1.5em;
            color: green;
        }
    </style>
</head>
  
<body ng-app="app" style="text-align:Center">
    <h1 style="color:green">GeeksforGeeks</h1>
    <h2>angular.bootstrap()</h2>
    <div ng-controller="geek">
        <span class="id">{{name}}</span>
        is the computer science portal for geeks.
    </div>
    <script>
        var app = angular.module("app", []);
        app.controller('geek', ['$scope', 
        function ($scope) {
            $scope.name = "GeeksforGeeks";
        }]);
        angular.bootstrap(document, ['app']);
    </script>
</body>
  
</html>
 
 

Output:

bootstrap

Example 2: This example describes the usage of the angular.bootstrap() Function in AngularJS by specifying the radio button.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>angular.bootstrap() Function</title>
    <script src=
"https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js">
    </script>
</head>
  
<body ng-app="app" style="text-align:Center">
    <h1 style="color:green">
        GeeksforGeeks
    </h1>
      
    <h2>angular.bootstrap()</h2>
      
    <div ng-controller="geek">
        <div class="col-md-3 well" 
            ng-init="count=0"> Male:
            <input type="radio" ng-model="gender" 
            value="Male" 
            ng-change="layout(gender)" /> Female:
            <input type="radio" ng-model="gender" 
            value="Female" ng-change="layout(gender)" />
            <pre>
                <b>You selected:</b> {{result}} 
            </pre>
        </div>
    </div>
  
    <script>
        var app = angular.module("app", []);
        app.controller('geek', ['$scope', 
        function ($scope) {
            $scope.layout = function (gender) {
                $scope.result = gender;
            }
        }]);
        angular.bootstrap(document, ['app']);
    </script>
</body>
  
</html>
 
 

Output:

 



Next Article
AngularJS angular.toJson() Function

V

Vishal Chaudhary 2
Improve
Article Tags :
  • AngularJS
  • Web Technologies
  • AngularJS-Function

Similar Reads

  • AngularJS angular.forEach() Function
    The angular.forEach() Function in AngularJS is used to iterate through each item in an array or object. It works similar to the for loop and this loop contains all properties of an object in key-value pairs of an object. Syntax: angular.forEach(object, iterator, [context])Parameter Values: object: I
    1 min read
  • AngularJS angular.bind() Function
    The angular.bind() Function in AngularJS is used to bind the current context to a function, but actually, execute it at a later time. It can also be used in Partial Applications. Partial Application is when you want to make a function but some of the arguments have been passed already. Syntax: angul
    2 min read
  • AngularJS angular.element() Function
    The angular.element() Function in AngularJS is used to initialize DOM element or HTML string as an jQuery element. If jQuery is available angular.element can be either used as an alias for the jQuery function or it can be used as a function to wrap the element or string in Angular's jqlite. Syntax:
    2 min read
  • AngularJS angular.toJson() Function
    The angular.toJson() Function in AngularJS is used to serialize the javascript object into a JSON - formatted string. It takes the javascript object and returns a JSON string. The angular.toJson() function in AngularJS is capable of handling circular references in JavaScript objects. Circular refere
    2 min read
  • AngularJS angular.isObject() Function
    The angular.isobject() Function in AngularJS is used to determine if the parameter inside isobject function is an object or not. It returns true if the reference is an object or else false. Syntax: angular.isobject(value);Parameter: value: This parameter value validates whether the entered value is
    2 min read
  • AngularJS angular.uppercase() Function
    The angular.uppercase() Function in AngularJS is used to convert the string into uppercase. It can be used when the user wants to show the text in uppercase instead of lowercase. Syntax: angular.uppercase(string)Example: This example illustrates the angular.uppercase() Function by specifying the str
    2 min read
  • AngularJS angular.lowercase() Function
    The angular.lowercase() Function in AngularJS is used to convert the string into lowercase. It can be used when the user wants to show the text in lowercase instead of uppercase or one wants to compare two strings. Syntax: angular.lowercase(string)Example 1: This example describes the implementation
    2 min read
  • Angular ngx Bootstrap Introduction
    Angular ngx Bootstrap is an open-source (MIT Licensed) project, that provides Bootstrap components powered by Angular, which does not require including any original JS components. This framework facilitates the creation of components with great styling with very easy to use, which, in turn, helps to
    4 min read
  • Angular ng Bootstrap Alert Component
    Angular ng bootstrap is a bootstrap framework used with angular to create components with great styling and this framework is very easy to use and is used to make responsive websites. In this article, we will see how to use Alert in angular ng bootstrap. Alert is used to provide contextual feedback
    2 min read
  • Angular MDBootstrap Clearfix Utilities
    MDBootstrap is a Material Design and bootstrap-based Angular UI library that is used to make attractive webpages with its seamless and easy-to-use component. In this article, we will know how to use Clearfix Utilities in Angular MDBootstrap.  The Clearfix Utilities is used to automatically clear or
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences