title: How to pass data a html file to .ts file in Ionic (latest) from a search bar input
body: <p>The below code carries the view and .ts . I wanted to enter an input in the search bar , the input must be passed from html to .ts and the Json data which i am requesting should be filtered correctly according to the data passed.The API Url is <a href="https://api.github.com/search/users?q=dines" rel="nofollow noreferrer">https://api.github.com/search/users?q=dines</a>, where the if q's value is changed , the names should be changed in the view.</p>
  
  <h1>home.html</h1>
  
  <p>This is my view template. </p>
  
  <pre><code>&lt;ion-header&gt;
    &lt;ion-navbar color="primary"&gt;
      &lt;ion-title&gt;
       Git Profiles
      &lt;/ion-title&gt;
    &lt;/ion-navbar&gt;
  &lt;/ion-header&gt;
  
  &lt;ion-content padding&gt;
  &lt;ion-item&gt;
      &lt;ion-searchbar floating [(ngModel)] = "myInput" (ionInput)="getNames($event) "&gt; Search&lt;/ion-searchbar&gt;
    &lt;/ion-item&gt;
  
  &lt;ion-card *ngFor = "let post of posts?.items"&gt;
  
    &lt;ion-item&gt;
      &lt;ion-avatar item-start&gt;
        &lt;img [src] = "post?.avatar_url" alt="" /&gt;
      &lt;/ion-avatar&gt;
    &lt;/ion-item&gt;
    &lt;ion-card-content&gt;
      &lt;p&gt;Name : {{post.login}}&lt;/p&gt;
      &lt;p&gt;Score : {{post.score}}&lt;/p&gt;
    &lt;/ion-card-content&gt;
  
  &lt;/ion-card&gt;
  
  &lt;/ion-content&gt;
  </code></pre>
  
  <h1>home.ts</h1>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { NavController } from 'ionic-angular';
  import { PostProvider } from '../../providers/post/post';
  
  @Component({
    selector: 'page-about',
    templateUrl: 'about.html'
  })
  export class AboutPage implements OnInit {
  
     posts:Post[];
  
    constructor(public navCtrl: NavController , private PostProvider: PostProvider ) {
    }
  
  
  ngOnInit()
  {
    this.PostProvider.getPosts().subscribe((posts)=&gt; {
       this.posts = posts;
    });
  }
  }
  
  interface Post{
    login:string,
    avatar_url:any,
    score:number
  }
  </code></pre>