I'm trying to implement ''Dropdown'' with filter(search) in AngularJS. While trying i'm not getting as 'dropdown' select menu. The following images show before and after search in dropdown.
A text inbox like structuring is appearing while searching.
Please help me to fix this and where i'm going wrong.
Thanks in advance.
My code follows here:
<html>
<head>
<title>Select with search</title>
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.css" />
<link rel="stylesheet" type="text/css"
href="node_modules/ui-select/dist/select.min.css" />
<script src="node_modules/angular/angular.min.js"></script>
<script src="node_modules/ui-select/dist/select.min.js"></script>
</head>
<body>
<div ng-app="myApp" ng-controller="selectCtrl">{{1+1}}
<ui-select ng-model="num.selected" theme='bootstrap'>
<ui-select-match>
{{$select.selected.name}}
</ui-select-match>
<ui-select-choices repeat='n in nums | filter: $select.search'>
{{n.name}} ({{n.email}})
</ui-select-choices>
</ui-select>
</div>
<script>
var app = angular.module("myApp", ['ui.select']);
app.controller("selectCtrl", function($scope) {
$scope.num = {};
$scope.nums = [{
name: 'apple',
email: '[email protected]'
},
{
name: 'alfa',
email: '[email protected]'
},
{
name: 'bat',
email: '[email protected]'
},
{
name: 'cat',
email: '[email protected]'
},
{
name: 'dog',
email: '[email protected]'
},
{
name: 'monkey',
email: '[email protected]'
}
];
});
</script>
</body>
</html>

