@@ -1402,10 +1402,17 @@ function getNgAttribute(element, ngAttr) {
1402
1402
* designates the **root element** of the application and is typically placed near the root element
1403
1403
* of the page - e.g. on the `<body>` or `<html>` tags.
1404
1404
*
1405
- * Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`
1406
- * found in the document will be used to define the root element to auto-bootstrap as an
1407
- * application. To run multiple applications in an HTML document you must manually bootstrap them using
1408
- * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other.
1405
+ * There are a few things to keep in mind when using `ngApp`:
1406
+ * - only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`
1407
+ * found in the document will be used to define the root element to auto-bootstrap as an
1408
+ * application. To run multiple applications in an HTML document you must manually bootstrap them using
1409
+ * {@link angular.bootstrap} instead.
1410
+ * - AngularJS applications cannot be nested within each other.
1411
+ * - Do not use a directive that uses {@link ng.$compile#transclusion transclusion} on the same element as `ngApp`.
1412
+ * This includes directives such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and
1413
+ * {@link ngRoute.ngView `ngView`}.
1414
+ * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},
1415
+ * causing animations to stop working and making the injector inaccessible from outside the app.
1409
1416
*
1410
1417
* You can specify an **AngularJS module** to be used as the root module for the application. This
1411
1418
* module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It
@@ -1545,16 +1552,25 @@ function angularInit(element, bootstrap) {
1545
1552
* @description
1546
1553
* Use this function to manually start up angular application.
1547
1554
*
1548
- * See: {@link guide/bootstrap Bootstrap}
1549
- *
1550
- * Note that Protractor based end-to-end tests cannot use this function to bootstrap manually.
1551
- * They must use {@link ng.directive:ngApp ngApp}.
1555
+ * For more information, see the {@link guide/bootstrap Bootstrap guide}.
1552
1556
*
1553
1557
* Angular will detect if it has been loaded into the browser more than once and only allow the
1554
1558
* first loaded script to be bootstrapped and will report a warning to the browser console for
1555
1559
* each of the subsequent scripts. This prevents strange results in applications, where otherwise
1556
1560
* multiple instances of Angular try to work on the DOM.
1557
1561
*
1562
+ * <div class="alert alert-warning">
1563
+ * **Note:** Protractor based end-to-end tests cannot use this function to bootstrap manually.
1564
+ * They must use {@link ng.directive:ngApp ngApp}.
1565
+ * </div>
1566
+ *
1567
+ * <div class="alert alert-warning">
1568
+ * **Note:** Do not bootstrap the app on an element with a directive that uses {@link ng.$compile#transclusion transclusion},
1569
+ * such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and {@link ngRoute.ngView `ngView`}.
1570
+ * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},
1571
+ * causing animations to stop working and making the injector inaccessible from outside the app.
1572
+ * </div>
1573
+ *
1558
1574
* ```html
1559
1575
* <!doctype html>
1560
1576
* <html>
0 commit comments