@@ -1402,6 +1402,14 @@ function bootstrap(element, modules, config) {
14021402 modules . unshift ( [ '$provide' , function ( $provide ) {
14031403 $provide . value ( '$rootElement' , element ) ;
14041404 } ] ) ;
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+
14051413 modules . unshift ( 'ng' ) ;
14061414 var injector = createInjector ( modules , config . strictDi ) ;
14071415 injector . invoke ( [ '$rootScope' , '$rootElement' , '$compile' , '$injector' ,
@@ -1415,8 +1423,14 @@ function bootstrap(element, modules, config) {
14151423 return injector ;
14161424 } ;
14171425
1426+ var NG_ENABLE_DEBUG_INFO = / ^ N G _ E N A B L E _ D E B U G _ I N F O ! / ;
14181427 var NG_DEFER_BOOTSTRAP = / ^ N G _ D E F E R _ B O O T S T R A P ! / ;
14191428
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+
14201434 if ( window && ! NG_DEFER_BOOTSTRAP . test ( window . name ) ) {
14211435 return doBootstrap ( ) ;
14221436 }
@@ -1430,6 +1444,32 @@ function bootstrap(element, modules, config) {
14301444 } ;
14311445}
14321446
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+
14331473var SNAKE_CASE_REGEXP = / [ A - Z ] / g;
14341474function snake_case ( name , separator ) {
14351475 separator = separator || '_' ;
0 commit comments