mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(core): drop injection context assertion in production (#62038)
Drops `assertInInjectionContext` call in production in `afterNextRender`. PR Close #62038
This commit is contained in:
parent
8d049f533a
commit
21dfbf3ada
1 changed files with 4 additions and 1 deletions
|
|
@ -389,7 +389,10 @@ export function afterNextRender(
|
|||
},
|
||||
options?: AfterRenderOptions,
|
||||
): AfterRenderRef {
|
||||
!options?.injector && assertInInjectionContext(afterNextRender);
|
||||
if (ngDevMode && !options?.injector) {
|
||||
assertInInjectionContext(afterNextRender);
|
||||
}
|
||||
|
||||
const injector = options?.injector ?? inject(Injector);
|
||||
|
||||
if (typeof ngServerMode !== 'undefined' && ngServerMode) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue