angular/angular#11228 (comment)
@Component({
...
providers: [MyService],
template: '<router-outlet></router-outlet>'
})
export class MyNavWrapperComponent {
// Must inject to instantiate service for all child routes.
// When this component is destroyed, the service will be too.
constructor(service: MyService) { }
}
routes: Routes = [
{
path: '',
component: MyNavWrapperComponent,
children: [ ... ],
}
]