Closed rkmahale17 closed 7 years ago
I am not sure I am following (the code is a little bit messy to understand :) ) Anyways, Iv'e checked it up and everything looks fine (I updated README though):
my home.ts:
import {Component, ViewChild} from '@angular/core';
import { NavController } from 'ionic-angular';
import {CompleteTestService} from "../../app/auto";
import {AutoCompleteComponent} from "ionic2-auto-complete/dist";
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
@ViewChild('searchbar')
searchbar: AutoCompleteComponent;
constructor(public navCtrl: NavController, private completeTestService: CompleteTestService) {
}
clicked() {
console.log(this.searchbar.getValue());
}
}
And my home.html:
<ion-header>
<ion-navbar>
<ion-title>Home</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<ion-auto-complete [dataProvider]="completeTestService" #searchbar></ion-auto-complete>
<button (click)="clicked()">click</button>
</ion-content>
ionic2-auto-complete@1.4.2-rc0
@rkmahale17 I believe that this is not the same issue we were talking about
No this is not that issuse , after upgrating to ionic2-auto-complete@1.4.2-rc0.....label attribute issue solved ..but this function calling is not happening......
@rkmahale17 please review my latest comment in #42
Yes.... it is working....
Thank You so much......
cause error of getValue is undefine
code is like
@ViewChild('searchbar') searchbar: any; and calling function console.log(this.searchbar.getValue()); in autocomplete.componenent.ts
public getValue() { this.keyword return }
} in <ion-autocomplete #searchbar></ same>