Can Angular components be extended? And if so, is it possible to create a list of diverse components (using an ngFor loop) that all extend a common base component?
For instance, could a custom menu bar display various types of menu items, such as dropdown menus, buttons, text boxes, etc., all extending the same "CustomMenuItem" component with shared functionality?
@Component({
selector: 'custom-menu-bar',
inputs: ['customMenuItems'],
outputs: ['onMenuEvent'],
template: `
<div class="row">
<custom-menu-item *ngFor="#item of customMenuItems">
...
</custom-menu-item>
</div>
`
})
export class CustomMenuBar {
customMenuItems: CustomMenuItem[];
onMenuEvent: EventEmitter<MenuEvent>;
//...
}