AngularJS | angular.bootstrap() Function
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) which is the root of the Angular application.
- Modules: (Optional)Modules is an array of modules to be loaded.
- Config: (Optional)Config is an object used for configuration options.
Example 1:
<html> <head> <title>angular.bootstrap()</title> <script src= </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> |
chevron_right
filter_none
Output:

Example 2:
</div> <html> <head> <title>angular.bootstrap()</title> <script src= </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> |
chevron_right
filter_none
Output:
Before Selection:

After Selection:

Recommended Posts:
- PHP | imagecreatetruecolor() Function
- p5.js | year() function
- D3.js | d3.utcTuesdays() Function
- PHP | Ds\Sequence last() Function
- PHP | array_udiff_uassoc() Function
- PHP | geoip_continent_code_by_name() Function
- D3.js | d3.map.set() Function
- PHP | opendir() Function
- PHP | cal_to_jd() Function
- D3.js | d3.bisectLeft() Function
- PHP | stream_get_transports() Function
- PHP | Ds\Deque pop() Function
- PHP | SimpleXMLElement children() Function
- AngularJS | ng-show Directive
- PHP | is_numeric() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



