title: Angular 7: Overwrite parent class of third party components
body: <p>I have to work with many components of a third party library that all extend an abstract class which behavior I have to alter. To make it more clear, see the following lines of sample code:</p>
  
  <pre class="lang-js prettyprint-override"><code>abstract class ThirdPartyParentClass {
    parentMethod() {
      // I need to alter this method...
    }
  }
  
  class ThirdPartyComponent1 extends ThirdPartyParentClass {
    componentMethod() {
      parentMethod();  // ...because it gets called here...
    }
  }
  
  class ThirdPartyComponent2 extends ThirdPartyParentClass {
    componentMethod() {
      parentMethod();  // ...and here...
    }
  }
  
  // ...and in a few other places.
  </code></pre>
  
  <p>One obvious solution would be to extend the parent class, overwrite the respective method, and duplicate the code of all its components, making them extend my custom parent class instead. However, since the third party library is currently under heavy development, I fear that I would introduce a lot of technical debt by doing so.</p>
  
  <p>Is there another possibility to reach this goal?</p>