Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49249

Search result won't show on iOS device

$
0
0

@Dar3lis wrote:

Hey, guys.
I’m working on search feature, and I made it work, but then realised it’s not working on an iOS device ( show’s nothing) while it works perfectly on the web. Is it something with xCode or what’s happening?

search.ts



    constructor () {
       this.dataRefreshed();
}
 // get search results
    dataRefreshed(){
      this.campaigns = JSON.parse(localStorage.getItem('campaigns_data'))
    }

    getItems(ev: any) {
      this.dataRefreshed();
      let val = ev.target.value;
      if (val && val.trim() != '') {
        this.campaigns = this.campaigns.filter((item) => {
          return (item.camp_title.toLowerCase().indexOf(val.toLowerCase()) > -1);
        });
        this.showResults = true;
      }
      if (!val || val.trim() == ''){
        this.showResults = true;
      }
    }


.html

<div class="suggested-campaigns">
      <ion-list  style="width: 94%; margin: 0 auto;">
        <ion-item *ngFor="let item of campaigns | slice:0:5 " (click)=goToCampaign(item.id); class="camp-li search-li">
          <div item-left class="list-image" *ngIf="bannerExists(item.defaultBanner) == 1">
           <img class="search-img" src="https://publisher.adservice.com{{item.defaultBanner}}">
          </div>
           <div item-left class="list-image" *ngIf="bannerExists(item.defaultBanner)==0">
               <img class="search-img" src="assets/no_campaign_image_125x125.png">
          </div>
          <span class="small block lighter-color">
          {{ item.camp_title | truncate: 33 }}
          </span>
      </ion-item>
</ion-list>
</div>

and on ios Device, nothing is showing.

Any help would be appreciated ! :confused:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49249

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>