I was trying to create a custom directive for jQuery UI ComboBox , it should work like an autosuggestion and dropdown. Neither i am getting the look and feel nor the logic. I want to use it as it is given in the JQueryUI
var DataApp = angular.module("DataApp", []);
DataApp.controller('loginCtrl', loginCtrl);
var loginCtrl = function ($scope) {
$scope.listLang = [{
lang: "AppleScript"}, {
lang: "Asp"
}, {
lang: "BASIC"
}, {
lang: "C"
}, {
lang: "C++"
}, {
lang: "Clojure"
}, {
lang: "COBOL"
}, {
lang: "ColdFusion"
}, {
lang: "Erlang"
}];
};
DataApp.directive('comboBox1', function() {
return {
restrict : 'A',
link: function(scope, element, attrs) {
$(element).combobox();
}
}
});
HTML is given below
<div ng-app="DataApp">
<div ng-contorller="loginCtrl">
<div class="ui-widget" combo-box1='{}'>
<label>Your preferred programming language:</label>
<select id="combobox" ng-model="list-items" ng-options="listItem.lang for listItem in listLang"></select>
</div>
</div>