File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
1
import {
2
2
ChangeDetectorRef ,
3
3
Component ,
4
+ createEnvironmentInjector ,
4
5
Directive ,
5
6
effect ,
6
7
EnvironmentInjector ,
@@ -76,10 +77,15 @@ export class NgtRouterOutlet extends RouterOutlet {
76
77
private environmentInjector = inject ( EnvironmentInjector ) ;
77
78
78
79
override activateWith ( activatedRoute : ActivatedRoute , environmentInjector : EnvironmentInjector ) : void {
79
- return super . activateWith (
80
- activatedRoute ,
81
- new NgtOutletEnvironmentInjector ( environmentInjector , this . environmentInjector ) ,
82
- ) ;
80
+ const activateWithEnvInjector =
81
+ this . environmentInjector === environmentInjector
82
+ ? environmentInjector
83
+ : createEnvironmentInjector (
84
+ [ ] ,
85
+ new NgtOutletEnvironmentInjector ( environmentInjector , this . environmentInjector ) ,
86
+ ) ;
87
+
88
+ return super . activateWith ( activatedRoute , activateWithEnvInjector ) ;
83
89
}
84
90
}
85
91
You can’t perform that action at this time.
0 commit comments