title: Angular 9 | Can't bind to 'loading' since it isn't a known property of 'img'
body: <p>I'm using Angular 9 and I'm simple trying to bind the attribute "loading" of the img element to a Angular property. This works if I run the app in dev mode, but not in prod mode.</p>
  
  <p>In my template I have this:</p>
  
  <pre><code>&lt;img [src]="image" [loading]="loading" [alt]="title"&gt;
  </code></pre>
  
  <p>And in the component I have this:</p>
  
  <pre><code>import { Component, OnInit, Input } from '@angular/core';
  
  @Component(
  {
      selector: 'image-card',
      templateUrl: './image-card.component.html',
      styleUrls: ['./image-card.component.scss'],
  })
  export class ImageCardComponent implements OnInit
  {
      @Input() loading:"lazy" | "eager" = "lazy";
      @Input() title:string;
      @Input() image?:string;
  
      constructor() { }
  
      ngOnInit() 
      {
          this.image = this.image || "assets/images/default_image.jpg";
      }
  }
  </code></pre>
  
  <p>This is working on a dev build/ng serve, but if I run a prod build:</p>
  
  <pre><code>ng build --prod
  </code></pre>
  
  <p>I get the error:</p>
  
  <blockquote>
    <p>Can't bind to 'loading' since it isn't a known property of 'img'.</p>
  </blockquote>
  
  <p>The property exists, <a href="https://caniuse.com/#search=loading" rel="noreferrer">https://caniuse.com/#search=loading</a> why I'm getting the error?</p>
  
  <p>How can I exclude this validation/restriction on a prod build?</p>
  
  <p>For example the alt bind works fine with no errors.</p>
  
  <p>EDIT: to include better code samples.</p>