Skip to content

Commit 526268c

Browse files
arturovtAndrewKushnir
authored andcommitted
refactor(core): inline standalone check to be dropped (angular#60305)
Inlines `standalone` check into the message to be dropped. PR Close angular#60305
1 parent 7677578 commit 526268c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/core/src/application/application_ref.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,15 @@ export class ApplicationRef {
508508
const initStatus = this._injector.get(ApplicationInitStatus);
509509

510510
if (!initStatus.done) {
511-
const standalone = !isComponentFactory && isStandalone(componentOrFactory);
512-
const errorMessage =
513-
(typeof ngDevMode === 'undefined' || ngDevMode) &&
514-
'Cannot bootstrap as there are still asynchronous initializers running.' +
511+
let errorMessage = '';
512+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
513+
const standalone = !isComponentFactory && isStandalone(componentOrFactory);
514+
errorMessage =
515+
'Cannot bootstrap as there are still asynchronous initializers running.' +
515516
(standalone
516517
? ''
517518
: ' Bootstrap components in the `ngDoBootstrap` method of the root module.');
519+
}
518520
throw new RuntimeError(RuntimeErrorCode.ASYNC_INITIALIZERS_STILL_RUNNING, errorMessage);
519521
}
520522

0 commit comments

Comments
 (0)