title: Correct way to package an Angular library to support Angular 8, 9 and 10
body: <p>With Angular 10 being released, I am updating the version of Angular used to build a library + demo application to version 10.</p>
  <p>Generally this goes smoothly, and the library remains compatible with previous versions of Angular, but this doesn't seem to be the case with this release (prior version build against Angular 9 works fine with Angular 8).</p>
  <p>The output typescript definition files include:</p>
  <pre><code>import * as ɵngcc0 from '@angular/core';
  
  ...
  
  static ɵfac: ɵngcc0.ɵɵFactoryDef&lt;QrCodeComponent, never&gt;;
  static ɵcmp: ɵngcc0.ɵɵComponentDefWithMeta&lt;QrCodeComponent, &quot;qr-code&quot;, never, { &quot;value&quot;: &quot;value&quot;; &quot;size&quot;: &quot;size&quot;; &quot;errorCorrectionLevel&quot;: &quot;errorCorrectionLevel&quot;; }, {}, never, never&gt;;
  </code></pre>
  <p>Which causes errors like this when consuming in an Angular 8 project:</p>
  <pre><code> ERROR in node_modules/ng-qrcode/lib/qr-code.component.d.ts(7,25): error TS2694: Namespace '&quot;/ngqrcode-ng8-test/node_modules/@angular/core/core&quot;' has no exported member 'ɵɵFactoryDef'.
      node_modules/ng-qrcode/lib/qr-code.component.d.ts(8,18): error TS2314: Generic type 'ɵɵComponentDefWithMeta' requires 6 type argument(s).
      node_modules/ng-qrcode/lib/qr-code.directive.d.ts(13,25): error TS2694: Namespace '&quot;/ngqrcode-ng8-test/node_modules/@angular/core/core&quot;' has no exported member 'ɵɵFactoryDef'.
  </code></pre>
  <p>I created the test angular 8 project freshly using:</p>
  <pre><code>npx @angular/cli@^8 new ngqrcode-ng8-test
  </code></pre>
  <p>You can see my WIP pull request for this change here: <a href="https://github.com/mnahkies/ng-qrcode/pull/8" rel="noreferrer">https://github.com/mnahkies/ng-qrcode/pull/8</a></p>
  <p>Note: I already have enableIvy false in my compiler options:</p>
  <pre><code>&quot;angularCompilerOptions&quot;: {
      &quot;enableIvy&quot;: false
    }
  </code></pre>
  <p><strong>Is there a way to build a library using Angular v10 that maintains compatibility with Angular v8?</strong></p>