Ionic - SearchBar with Mysql Script


Firstly, Your function doesnt make any sense. I cant find this.items in your declarations where have u declared it??
I think you need to learn how the filter array function works. Secondly u need to initiate the function filterItems() on change event in text box.


Sorry i am all confused thats why i asked you to post the whole search.ts file.

you mean i should declared it like this


public items: any;


It works now but i anot getting the results it should sort. I am getting the same results regardless what i type in the searchbar

I want it to sort like autocomplete. to show results of what i type in the search bar


 @Component({ selector: "page-search", templateUrl: "search.html" })
  export class SearchPage {
  filter: string = '';
  public userDetails: any;
  public resposeData: any;
  public dataSet: any;
  public userSet: any;
  public mediaSet: any;
  public noRecords: boolean;
   userPostData = {
     uid: "",
     token: "",
     username: "",
     bio: ""
     public common: Common,
     public navCtrl: NavController,
     public app: App,
     public menu: MenuController,
     public authService: AuthService,
     public http: Http,
     platform: Platform,
     statusBar: StatusBar,
     splashScreen: SplashScreen
 ) {
 initializeItems() {
     return this.userPostData;
           getItems(ev: any) {

              let val =;

              if (val && val.trim() != '') {
                  this.authService.postData(this.userPostData, "userGroupSearch").then(
                      result => {
                          this.resposeData = result;
                          if (this.resposeData.allArtistsData) {
                              this.userSet = this.resposeData.allArtistsData;

                          } else {
                              console.log("No access");

What do you think @abhishekpatilxyz