mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08: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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user