If you open the dropdown and close it without selecting anything, the
console shows an error complaining that $scope.selected is undefined.
This commit checks that it exists in that case before using it.
Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
$scope.isopen = $scope.clickedopen || ($filter('filter')(
$scope.list,
$scope.selected
- ).length > 0 && $scope.selected.length > 0);
+ ).length > 0 && $scope.selected && $scope.selected.length > 0);
if ($scope.clickedclosed) {
$scope.isopen = false;
$scope.clickedclosed = null;