title: Angular WARNING: sanitizing unsafe style value
body: <p>UPDATE: I recommend people look in the link above first as there are some good solutions.</p>
  
  <p>However I could not get any of them to work for my particular case as my issue was not related to a url but width and height.</p>
  
  <p>Question:</p>
  
  <p>I am getting the following warning in the console with the following code:</p>
  
  <pre><code>WARNING: sanitizing unsafe style value calc(300px * 0.7509025270758123) (see http://g.co/ng/security#xss).
  </code></pre>
  
  <p>The code works fine but it is run for every image on my page and fills up the console.</p>
  
  <p>Any ideas how to remove the warning?</p>
  
  <pre><code>&lt;div 
     *ngIf="swipeFile.imageUrl" 
     class="linear-background" 
     [ngStyle]="{'width': '300px', 'height': 'calc(300px * ' + (swipeFile.imageHeight / swipeFile.imageWidth) + ')'}" &gt;
     &lt;img mat-card-image [src]="swipeFile?.imageUrl" alt="image"&gt;
  &lt;/div&gt;
  </code></pre>