title: How to Check value in JSON object ionic2
body: <p>How to check <code>"no_cover"</code> value in <code>thumbnail[0]</code> and replace it to <code>asset/sss.jpg</code> for show <code>listpage</code>
  I try to set <code>&lt;img src="{{item.LINKS.thumbnail[0]}}"&gt;</code> in Listpage.html ,this show only thumbnail[0] is <code>http://xxx.jpg</code>, <code>http://xxx.jpg</code> ,  ,But I have no idea to set "no_cover"</p>
  
  <p><strong>myjson</strong>    </p>
  
  <pre><code>"    DOCSET":{
        "DOC":[
         {
          "LINKS":{
  
            "thumbnail":"http://yyy.jpg",
            "thumbnail":"http://....jpg"}
          }],
        "DOC":[
         {
          "LINKS":{
  
            "thumbnail":"http://xxx.jpg",
            "thumbnail":"http://....jpg"}
          }],
        "DOC":[
          {
          "LINKS":{
  
            "thumbnail":"no_cover",     &lt;&lt;&lt;&lt;
            "thumbnail":"http://....jpg"}
          }]
       }
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT - HOW YOUR JSON SHOULD LOOK</strong></p>
  
  <p>Since I (ivaro18) believe you wrote your JSON by hand and did not copy a response object. Let me show you what valid JSON looks like:</p>
  
  <pre><code>{
      "DOCSET" : [
          {
              "DOC" : {
                  "LINKS" : [
                      {
                        "thumbnail" : "http://.....jpg"
                      },
                      {
                        "thumbnail" : "http://.....jpg"
                      }                
                  ]
               }
          },
          {
              "DOC" : {
                  "LINKS" : [
                      {
                        "thumbnail" : "http://.....jpg"
                      },
                      {
                        "thumbnail" : "http://.....jpg"
                      }                
                  ]
               }
          },
          {
              "DOC" : {
                  "LINKS" : [
                      {
                        "thumbnail" : "no_cover"
                      },
                      {
                        "thumbnail" : "http://.....jpg"
                      }                
                  ]
               }
          }
      ]
  }
  </code></pre>
  
  <p><strong>END OF EDIT</strong></p>
  
  <hr>
  
  <p><strong>listpage.html</strong></p>
  
  <pre><code>&lt;ion-list&gt;
      &lt;ion-item *ngFor="let item of foundRepos"&gt;
       &lt;ion-thumbnail item-left  &gt;
        &lt;img src="{{item.LINKS.thumbnail[0]}}"&gt;  &lt;!--I have no idea to set it --&gt;
      &lt;/ion-thumbnail&gt;
  &lt;/ion-list&gt;
  </code></pre>
  
  <p>list.page.ts</p>
  
  <pre><code>this.http.get("my_url")
   .subscribe(data =&gt;{
       this.foundRepos = data.json().DOCSET.DOC; 
                     },error=&gt;{
                   err =&gt; console.error(err),
                  () =&gt; console.log('getRepos completed')
              );
  </code></pre>