@@ -1402,6 +1402,14 @@ function bootstrap(element, modules, config) {
1402
1402
modules . unshift ( [ '$provide' , function ( $provide ) {
1403
1403
$provide . value ( '$rootElement' , element ) ;
1404
1404
} ] ) ;
1405
+
1406
+ if ( config . debugInfoEnabled ) {
1407
+ // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.
1408
+ modules . push ( [ '$compileProvider' , function ( $compileProvider ) {
1409
+ $compileProvider . debugInfoEnabled ( true ) ;
1410
+ } ] ) ;
1411
+ }
1412
+
1405
1413
modules . unshift ( 'ng' ) ;
1406
1414
var injector = createInjector ( modules , config . strictDi ) ;
1407
1415
injector . invoke ( [ '$rootScope' , '$rootElement' , '$compile' , '$injector' ,
@@ -1415,8 +1423,14 @@ function bootstrap(element, modules, config) {
1415
1423
return injector ;
1416
1424
} ;
1417
1425
1426
+ var NG_ENABLE_DEBUG_INFO = / ^ N G _ E N A B L E _ D E B U G _ I N F O ! / ;
1418
1427
var NG_DEFER_BOOTSTRAP = / ^ N G _ D E F E R _ B O O T S T R A P ! / ;
1419
1428
1429
+ if ( window && NG_ENABLE_DEBUG_INFO . test ( window . name ) ) {
1430
+ config . debugInfoEnabled = true ;
1431
+ window . name = window . name . replace ( NG_ENABLE_DEBUG_INFO , '' ) ;
1432
+ }
1433
+
1420
1434
if ( window && ! NG_DEFER_BOOTSTRAP . test ( window . name ) ) {
1421
1435
return doBootstrap ( ) ;
1422
1436
}
@@ -1430,6 +1444,32 @@ function bootstrap(element, modules, config) {
1430
1444
} ;
1431
1445
}
1432
1446
1447
+ /**
1448
+ * @ngdoc function
1449
+ * @name angular.reloadWithDebugInfo
1450
+ * @module ng
1451
+ * @description
1452
+ * Use this function to reload the current application with debug information turned on.
1453
+ *
1454
+ * To improve performance adding various debugging information can be disabled.
1455
+ * See {@link $compileProvider#debugInfoEnabled}.
1456
+ *
1457
+ * This overrides any setting of `$compileProvider.debugInfoEnabled()` that you defined in your
1458
+ * modules. If you wish to debug an application via this information then you should open up a debug
1459
+ * console in the browser then call this method directly in this console:
1460
+ *
1461
+ * ```js
1462
+ * angular.reloadWithDebugInfo();
1463
+ * ```
1464
+ *
1465
+ * The page should reload and the debug information should now be available.
1466
+ *
1467
+ */
1468
+ function reloadWithDebugInfo ( doReload ) {
1469
+ window . name = 'NG_ENABLE_DEBUG_INFO!' + window . name ;
1470
+ if ( doReload !== false ) window . location . reload ( ) ;
1471
+ }
1472
+
1433
1473
var SNAKE_CASE_REGEXP = / [ A - Z ] / g;
1434
1474
function snake_case ( name , separator ) {
1435
1475
separator = separator || '_' ;
0 commit comments