Arugama
December 28, 2017, 3:55pm
1
Someone knows how to hide a list when select a item.
<ion-item>
<ion-label floating>Host</ion-label>
<ion-input type="text" name ="Host" [(ngModel)]="user.Host" (input)="search_name($event)">
</ion-input>
</ion-item>
<button type="button" ion-item *ngFor="let item of _fs.result (click)="select_item(item)">
<ion-option>{{item.Name}}</ion-option>
</button>
Hi , on select_item set _fs.result null , if you want the chosen item be visible for the user you can push the item on _fs.result
Arugama
December 28, 2017, 4:32pm
3
do you mean add the _fs.result in my function select_item?
yes just do _fs.result = null on your function and puch your item in _fs.result
select_item(item){
_fs.result = nul ;
_fs.result.puchr(item);
.
.
.
Arugama
December 28, 2017, 4:49pm
5
awesome it works, thank u
Hello,
I do not know what your goal is, so this is only a suggestion.
A different way is maybe to use [hidden]='myvariableistrueorfalse’
This should hide whatever and not rebuild it.
Best regards, anna-liebt