Hide list when select a item(SOLVED)


#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>

#2

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


#3

do you mean add the _fs.result in my function select_item?


#4

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);
.
.
.

#5

awesome it works, thank u


#6

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