How to Hide list after Item click?


#1

Hello everyone,

this is my first post and my first question.
I allready tried to find out a solution by searching in this forum and google.

I made a view with few slides… on one slide I have few input fields… 3 of them should have something like a “livesearch” or better say an autocomplete.

So if the user clicks on an item, the ng-click method will hide the “list”

For my first List it works perfectly but for the second, it dont.

Please help me

The ng repeat will parse information from a json file with airports and airline companys

slide3.html

<label class="item item-input">
<span class="input-label">Fluggesellschaft</span>
<input
        type="search"
        ng-focus="ffa = true;"
        ng-model="searchffa.name"
        ng-init="searchffa.name = ''">
</label>

<ion-item class="list-inset"
      ng-model="ffa"
      ng-init="ffa = false"
      ng-if="ffa"
      ng-repeat="airline in airlines | filter: searchffa:strict | limitTo: 5"
      ng-click="searchffa.name = airline.company; sendData(airline.id); ffa = false;">
    {{airline.company}}
</ion-item>
<label class="item item-input">
<span class="input-label">Abflugort</span>
<input
        type="search"
        ng-model="searchabflug.name"
        ng-init="searchabflug.name = ''"
        ng-focus="toggleAbflug = true">
</label>
<li class="item list-inset"
ng-model="toggleAbflug"
ng-init="toggleAbflug = false"
ng-repeat="abflugort in airports | filter: searchabflug:strict | limitTo:5"
ng-if="toggleAbflug"
ng-click="searchabflug.name = abflugort.name;toggleAbflug = false">
{{abflugort.name}} - {{abflugort.city}}
</li>

Controller:

var CACHE = $cacheFactory("CACHE");
var fluggesellschaften = $http.get('fluggesellschaften.json', {cache: CACHE})
.success(function (data) {
    $scope.airlines = data;
})

var airports = $http.get('airports.json', {cache: CACHE})
.success(function (data) {
    $scope.airports = data;
})

So if anyone has a good solution I would be very happy to get help


#2

Nobody has an idea?
Would be great to hear from you