Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 1d9ac65

Browse files
committed
docs(bootstrap): add example that actually uses angular.bootstrap.
Closes #7032.
1 parent f452416 commit 1d9ac65

File tree

1 file changed

+19
-29
lines changed

1 file changed

+19
-29
lines changed

src/Angular.js

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,43 +1238,33 @@ function angularInit(element, bootstrap) {
12381238
*
12391239
* See: {@link guide/bootstrap Bootstrap}
12401240
*
1241-
* Note that ngScenario-based end-to-end tests cannot use this function to bootstrap manually.
1241+
* Note that Protractor based end-to-end tests cannot use this function to bootstrap manually.
12421242
* They must use {@link ng.directive:ngApp ngApp}.
12431243
*
12441244
* Angular will detect if it has been loaded into the browser more than once and only allow the
12451245
* first loaded script to be bootstrapped and will report a warning to the browser console for
12461246
* each of the subsequent scripts. This prevents strange results in applications, where otherwise
12471247
* multiple instances of Angular try to work on the DOM.
12481248
*
1249-
* <example name="multi-bootstrap" module="multi-bootstrap">
1250-
* <file name="index.html">
1251-
* <script src="../../../angular.js"></script>
1252-
* <div ng-controller="BrokenTable">
1253-
* <table>
1254-
* <tr>
1255-
* <th ng-repeat="heading in headings">{{heading}}</th>
1256-
* </tr>
1257-
* <tr ng-repeat="filling in fillings">
1258-
* <td ng-repeat="fill in filling">{{fill}}</td>
1259-
* </tr>
1260-
* </table>
1249+
* ```html
1250+
* <!doctype html>
1251+
* <html>
1252+
* <body>
1253+
* <div ng-controller="WelcomeController">
1254+
* {{greeting}}
12611255
* </div>
1262-
* </file>
1263-
* <file name="controller.js">
1264-
* var app = angular.module('multi-bootstrap', [])
1265-
*
1266-
* .controller('BrokenTable', function($scope) {
1267-
* $scope.headings = ['One', 'Two', 'Three'];
1268-
* $scope.fillings = [[1, 2, 3], ['A', 'B', 'C'], [7, 8, 9]];
1269-
* });
1270-
* </file>
1271-
* <file name="protractor.js" type="protractor">
1272-
* it('should only insert one table cell for each item in $scope.fillings', function() {
1273-
* expect(element.all(by.css('td')).count())
1274-
* .toBe(9);
1275-
* });
1276-
* </file>
1277-
* </example>
1256+
*
1257+
* <script src="angular.js"></script>
1258+
* <script>
1259+
* var app = angular.module('demo', [])
1260+
* .controller('WelcomeController', function($scope) {
1261+
* $scope.greeting = 'Welcome!';
1262+
* });
1263+
* angular.bootstrap(document, ['demo']);
1264+
* </script>
1265+
* </body>
1266+
* </html>
1267+
* ```
12781268
*
12791269
* @param {DOMElement} element DOM element which is the root of angular application.
12801270
* @param {Array<String|Function|Array>=} modules an array of modules to load into the application.

0 commit comments

Comments
 (0)