@@ -1402,10 +1402,17 @@ function getNgAttribute(element, ngAttr) {
14021402 * designates the **root element** of the application and is typically placed near the root element
14031403 * of the page - e.g. on the `<body>` or `<html>` tags.
14041404 *
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.
14091416 *
14101417 * You can specify an **AngularJS module** to be used as the root module for the application. This
14111418 * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It
@@ -1545,16 +1552,25 @@ function angularInit(element, bootstrap) {
15451552 * @description
15461553 * Use this function to manually start up angular application.
15471554 *
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}.
15521556 *
15531557 * Angular will detect if it has been loaded into the browser more than once and only allow the
15541558 * first loaded script to be bootstrapped and will report a warning to the browser console for
15551559 * each of the subsequent scripts. This prevents strange results in applications, where otherwise
15561560 * multiple instances of Angular try to work on the DOM.
15571561 *
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+ *
15581574 * ```html
15591575 * <!doctype html>
15601576 * <html>
0 commit comments