How to extend / inherit components?

后端 未结 12 835
萌比男神i
萌比男神i 2020-12-02 04:11

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

12条回答
  •  囚心锁ツ
    2020-12-02 05:02

    Angular 2 version 2.3 was just released, and it includes native component inheritance. It looks like you can inherit and override whatever you want, except for templates and styles. Some references:

    • New features in Angular 2.3

    • Component Inheritance in Angular 2

    • A Plunkr demonstrating component inheritance

提交回复
热议问题