title: Print filtered array(object) ionic4/angular
body: <p>I didn't understand how to pass data from .ts page to .html page in ionic angular.</p>
  
  <p>Array:</p>
  
  <pre><code>this.s1mstatus = [
    {
    "code" : "01",
    "descr" : "Text1."
    },
    {
    "code" : "02",
    "descr" : "Text2."
    },
    {
    "code" : "03",
    "descr" : "Text3."
    }
  ]
  </code></pre>
  
  <p>HTML page</p>
  
  <pre><code>&lt;ion-content fullscreen&gt;
    &lt;ion-grid&gt;
      &lt;ion-row&gt;
        &lt;ion-col&gt;
            &lt;ion-item [ngClass]="roundedInput" class="roundedInput"&gt;
                &lt;ion-input type="text" placeholder="Enter M-Status Code" [(ngModel)]="s1mstatus_get" maxlength="2"&gt;&lt;/ion-input&gt;
                &lt;ion-button type="submit" (click)="mstatussend()"&gt;Submit&lt;/ion-button&gt;
            &lt;/ion-item&gt;
        &lt;/ion-col&gt;
      &lt;/ion-row&gt;
  
      &lt;ion-row&gt;
        &lt;ion-col&gt;
          &lt;ion-item class="roundedInput"&gt;
              &lt;ion-input type="text" placeholder="Enter M-Data Code" [(ngModel)]="s1mdata_get"&gt;&lt;/ion-input&gt;
              &lt;ion-button type="submit" (click)="mstatussend()"&gt;Submit&lt;/ion-button&gt;
          &lt;/ion-item&gt;
        &lt;/ion-col&gt;
      &lt;/ion-row&gt;
    &lt;/ion-grid&gt;
    &lt;ion-list  *ngFor="let s1ms of s1filtered"&gt;
      &lt;ion-card class="card-border"&gt;
        &lt;ion-card-header&gt;
          &lt;ion-card-subtitle&gt;M-STATUS: {{s1ms.code}}&lt;/ion-card-subtitle&gt;
          &lt;/ion-card-header&gt;
          &lt;ion-card-content&gt;
            &lt;p&gt;ERROR MESSAGE:&lt;/p&gt;
            &lt;p class="ion-black" [innerHTML]="s1ms.descr"&gt;&lt;/p&gt;
          &lt;/ion-card-content&gt;
      &lt;/ion-card&gt;
    &lt;/ion-list&gt;
  &lt;/ion-content&gt;
  </code></pre>
  
  <p>FUNCTION TO CHECK IF EMPTY AND "DO SOMETHING" IF ISN'T:</p>
  
  <pre><code>mstatussend() {
     if(this.s1mstatus_get=="" || this.s1mstatus_get==undefined){
       this.roundedInput = 'invalid';
     }
     else if(this.s1mstatus_get=="" || this.s1mstatus_get==undefined){
       this.roundedInput = 'invalid';
     }
     else {
       this.roundedInput = 'valid';
       var s1filtered = this.s1mstatus.filter(element =&gt; element.code == this.s1mstatus_get);
       console.log(s1filtered);
     }
   };
  </code></pre>
  
  <p>As You can see by the screenshot the console.log command works but I didn't understand how to print those values on the HTML page, maybe it's something easy but is driving me mad.</p>
  
  <p><a href="https://i.stack.imgur.com/6fzIY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6fzIY.png" alt="enter image description here"></a></p>