It seems that Angular triggers the ngOnDestroy() method of dynamically created components when their parent component is removed by the Router.
If you'd like to see a live example, check out this Plunker: https://plnkr.co/edit/rAX6745xZi6EvP8N78IL?p=preview
import {Component, NgModule,Injector, ComponentFactoryResolver,
TemplateRef, ViewChild, ViewContainerRef} from '@angular/core'
import {BrowserModule} from '@angular/platform-browser'
import {Routes, RouterModule, Route} from '@angular/router';
@Component({
selector: 'my-other',
template: `<div>other</div>`
})
export class Other {}
// More code snippets and component definitions...
@NgModule({
imports: [ BrowserModule, RouterModule.forRoot(routes ],
declarations: [ App, MyComp, Parent, Other ],
entryComponents: [MyComp],
bootstrap: [ App ]
})
export class AppModule {}