0

可否请您告诉我如何在用户从列表中选择项目时如何隐藏列表。实际上,当用户在文本字段上键入任何内容时,它会显示一个列表,当用户从列表中选择任何行时,它会在文本字段上设置值。但那段时间,我需要隐藏我的列表。所以我带一个布尔变量$ scope.islisthide = false;使用该值我需要隐藏或显示列表。请按“a”比从列表中选择值。我已经使用ng-show但如何添加条件。如何在用户从列表中选择项目时隐藏列表?

<div class="listcontainer" ng-show="SEARCH.stationCode" > 
    <li ng-click="rowclick(station)" class="item" ng-repeat="station in data.data | filter:SEARCH.stationCode :startsWith">{{station.stationName+"-("+station.stationCode+")"}}</li> 
</div> 

$scope.rowclick = function(station) { 
    $scope.SEARCH.stationCode=station.stationCode; 
    // $scope.$apply(); 
} 

这里是我的代码 http://codepen.io/anon/pen/zGYPWj

回答

相关问题