.toLowerCase is not a function

i’m trying to make search bar … but i’m getting this error when i try to use it
.toLowerCase is not a function
html file

<ion-header no-border>
  <ion-toolbar no-border hideBackButton mode="ios">
    <ion-buttons start>
      <button ion-button navPop>
        <ion-icon class="back-icon" *ngIf=" this.Platform.dir() === 'ltr'" start name="md-arrow-round-back"></ion-icon>
        <ion-icon class="back-icon" *ngIf=" this.Platform.dir() === 'rtl'" start name="md-arrow-round-forward"></ion-icon>
    <ion-title class="page-title">{{'FCLINIC' | translate:param}}</ion-title>

<ion-searchbar *ngIf="isSearchbarOpened" ShowCancelButton="true"  (ionInput)="getClinc($event)" (ionCancel)="isSearchbarOpened=false"

    <ion-buttons end>
      <button ion-button end *ngIf="!isSearchbarOpened" (click)="isSearchbarOpened=true">
        <ion-icon class="search-icon" name="ios-search"></ion-icon>

<ion-content class="list-ion-content" no-border>
  <ion-list class="list-view" mode="ios">
    <button no-border ion-item *ngFor="let Clinic of CLinics" (click)="pushProfile(Clinic.id)">
      <ion-avatar class="img-view" item-start>
        <img [src]="Clinic.image">
      <h3 class="text-header">{{Clinic.name}}</h3>
      <p class="text-info">{{Clinic.address}}</p>
<ion-icon class="rate-icon" item-end [name]="Clinic.stars < 1 ? 'md-star-outline' : 'md-star-half' ">
        <ion-note class="rate-num">{{Clinic.stars}}</ion-note>



ts file

  import {
  } from '@angular/core';
  import {
  } from 'ionic-angular';
  import { ClinicProfilePage } from '../clinic-profile/clinic-profile';

    selector: 'page-clinc',
    templateUrl: 'clinc.html',
  export class ClincPage {
    CLinics: string[];
    public isSearchbarOpened = false;
    constructor(public navCtrl: NavController, public navParams: NavParams, public Platform: Platform) {

      this.CLinics = this.navParams.get('Data');



    initializeItems() {
    getClinc(ev : any) {
      // console.log(ev)
      var val = ev.target.value;
      if (val && val.trim() != ''){
        this.CLinics.filter((Clinic => {
          return Clinic.toLowerCase().indexOf(val.toLowerCase()) > -1;


    pushProfile(id : string){
      this.navCtrl.push(ClinicProfilePage, { id : id })


data I getting it

also i tryied to use
but didn’t work

You can’t execute toLowerCase() on an object (Clinic in your case).
You have to execute it on a string-property directly.

return Clinic.city_name.toLowerCase().indexOf(val.toLowerCase()) > -1;
This will check if the city_name is equal to the val (all converted to lowercase)

It is more likely : Clinic[index].city_name

thank you for reply … no error now … didn’t return any thing

True, but he already uses a filter which stores the current object of the array (CLinics ) in Clinic

you right … but i still getting nothing now … what next? :sweat_smile:

any help guys … i stoped here

You’re getting nothing as .filter() does not change array that you are filtering, this returns a new array and you don’t assign this anywhere.
console.log() result of your filter() and you will see what is wrong

Try to remove this line at config.xml file.

…preference cor=“UIWebViewBounce” value=“false”