title: Show images added at run time user in Angular
body: <p>I'm working with Angular 5 and I'm trying to show images that the user has uploaded from their side.</p>
  
  <p>When user upload an image, I put this image inside the assets folder then I will save the image path and name in database (<strong>assets/images/userupload/example.jpg</strong>).</p>
  
  <p>then I will set this path as an image srouce <code>&lt;img src="assets/images/userupload/example.jpg" /&gt;</code></p>
  
  <p>but it shows <strong><em>404 (not found)</em></strong> error. Getting the url from the page source and trying to open it in new tab, I get this error <strong><em>ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'assets/images/userupload/example.jpg'</em></strong></p>
  
  <p>after angular gets compiled, every thing works perfectly, and non of the errors above appears any more.</p>
  
  <p>could someone point, what I'm doing wrong and should I place it in the assets folder in the first place? </p>
  
  <p>EDIT:
  html code</p>
  
  <pre><code>&lt;img *ngIf="carModel.imageUrl &amp;&amp; carModel.imageId" [src]="carModel.imageUrl" height=250 width=400 alt="car model"&gt;
  </code></pre>