Minimizing structure of my problem we have:
lib.module.ts (Module of library - wished to be unchanged)
@NgModule({
declarations: [
InternalComponent,
ExternalComponent
],
exports: [
ExternalComponent
]
})
export class LibModule {}
external.component.ts
@Component({
selector: 'external',
template: '<internal></internal> We are in external',
styles: ['']
})
export class ExternalComponent{}
internal.component.ts
@Component({
selector: 'internal',
template: 'This is internal',
styles: ['']
})
export class InternalComponent{}
So my duty is to extend ExternalComponent. As far as I know we inherit only logic from typescript. Css and html has to be managed independently, in my case - copied and a little bit modified. However how can I copy html of ExternalComponent while InternalComponent isn't exported from LibModule?
Let's say ExternalExtendComponent is declared in AppModule. In AppModule I cannot import InternalComponent. So I cannot have template in ExternalExtendComponent with tag <internal>. Any idea of going through that?
Simple solution might be writing my own module and don't use library's one. It would look like this: app.module.ts
Important thing is that we cannot import LibModule anywhere in the project couse of double declarations.