I would like to create extensions for some components already deployed in Angular 2, without having to rewrite them almost completely, as the base component could undergo ch
You can inherit @Input, @Output, @ViewChild, etc. Look at the sample:
@Component({
template: ''
})
export class BaseComponent {
@Input() someInput: any = 'something';
@Output() someOutput: EventEmitter = new EventEmitter();
}
@Component({
selector: 'app-derived',
template: '{{someInput}}',
providers: [
{ provide: BaseComponent, useExisting: DerivedComponent }
]
})
export class DerivedComponent {
}