title: Check if a value exist before trying to display it Angular 4
body: <p>I'm on a project using Angular 4. </p>
  
  <p>I'm using a code like this :</p>
  
  <pre><code>&lt;div *ngFor="let item of results"&gt;
   &lt;p&gt; {{item.location.city}} &lt;/p&gt;
   &lt;p&gt; {{item.location.country}} &lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>To show some results from a json i get with a request.</p>
  
  <p>The problem is that my BDD is not well constructed and sometime, there is no location. As soon as there is a problem with a value, the rest of the result stop to display, which is a bit annoying. </p>
  
  <p>Is there a way to check if the value exist, and if it's the case let angular show it. I try with ngIf but got the same problem as angular try to see if there is a value and if not stop the ngfor.</p>
  
  <p>You can see the problem in live here : <a href="http://yunomusic.com/page-search-event" rel="nofollow noreferrer">http://yunomusic.com/page-search-event</a> (try with paris as city ad scroll down you will see this : 
  <a href="https://i.stack.imgur.com/9i1VB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9i1VB.jpg" alt="problem screenshot"></a></p>
  
  <p>and the error i got from console :</p>
  
  <pre><code>vendor.fa8737033d56bf5e7c33.bundle.js:17 ERROR TypeError: Cannot read property 'city' of undefined
      at Object.eval [as updateDirectives] (e.ngfactory.js:163)
      at Object.updateDirectives (vendor.fa8737033d56bf5e7c33.bundle.js:136)
      at ur (vendor.fa8737033d56bf5e7c33.bundle.js:136)
      at wr (vendor.fa8737033d56bf5e7c33.bundle.js:136)
      at br (vendor.fa8737033d56bf5e7c33.bundle.js:136)
      at ur (vendor.fa8737033d56bf5e7c33.bundle.js:136)
      at wr (vendor.fa8737033d56bf5e7c33.bundle.js:136)
      at br (vendor.fa8737033d56bf5e7c33.bundle.js:136)
      at ur (vendor.fa8737033d56bf5e7c33.bundle.js:136)
      at wr (vendor.fa8737033d56bf5e7c33.bundle.js:136)
  </code></pre>
  
  <p>angular try to read the component city but on some element in my BDD i don't have one. I need to check before showing.</p>
  
  <p>Thanks in advance !</p>