I have a dropdown menu that closes if something is selected but stays open if nothing is selected. I am trying to do it so that it closes when the fa fa-caret-down arrow is clicked but it is not doing the trick. How can I fix it? Here is the code for that part:
<label style="color:white;">How many players?</label>
<div ng-class="{true:'error-bron', false:'nonerror-bron'}[dropDownPeopleError===true]" class="dropdown" ng-click="test()">
<span>{{dropDownPeople}}</span>
<i class="fa fa-caret-down bron-caret" aria-hidden="true" ng-click="test(); $event.stopPropagation();"></i>
<div class="dropdown-content" ng-show="form.showDropDownPeople">
<a ng-repeat="item in people" ng-click="changePeople(item); $event.stopPropagation();">{{item}}</a>
</div>
</div>
And here is the part of my controller
$scope.test = function(){
$scope.form.showDropDownPeople = true;
}