Search functional issue

when i clear the search box it still showin the only search previous list item is not showing

i want to do like that Please click here.
here is my full code how can i do that please suggest me.

items:any[] = [];
mydata: any;

  constructor(public navCtrl: NavController, public navParams: NavParams, public http: Http) {

  //start auto load
 let self = this;
  setInterval(function () {
  }, 300); 

 ngOnInit() {

  setItems() {
    this.items = this.items;

  filterItems(ev: any) {
    let val =;

      if (val && val.trim() !== '') {
      this.items = this.items.filter(function(item) {
        return item.userName.toLowerCase().includes(val.toLowerCase());
  ionViewDidLoad() {
   var headers = new Headers();
    headers.append('Content-Type', 'application/x-www-form-urlencoded');
    let options = new RequestOptions({ headers: headers });

      let dataTemp = res.json(); //dataTemp is the json object you showed me
      this.mydata = dataTemp.viewleadusers; //contains a [] object with all yours user
      for(let i = 0; i < this.mydata.length; i++){
            let a = this.mydata[i].userName;
            let b= this.mydata[i].userID;
               "userID": b,

There is much to say about this code

I will say these things

Dont use function but the fat arrow syntax to preserve context: ()=>{}

SetItems function does nothing or at least not what you probably intend. You probably need a loadedList and a filteredList variable.

And the self.items; in the interval also doesnt do anything usefull I would say. It is not a function call

Next, you can replace the for loop with a .map(value=>{…}) which is easier to reas and less bug sensitive

And so on…