Could anybody please tell me how to make custom directive in angular js .I am trying to make autocomplete using jquery-autocomplete in angular-js.
In jQuery it is display like this http://jsfiddle.net/dfapnrxf/ or this https://jqueryui.com/autocomplete/
I am trying to make this type of autocomplete in angular-js
So I made custom directive .But could you please tell me where I am doing wrong ?
This is my code:
http://codepen.io/anon/pen/eNZLpp
var app=angular.module("ionicApp",['ionic']);
app.directive('autosemple',function(){
return{
restrict:'A',
scope:{
},
link:function(scope,element,attr){
$( "#tags" ).autocomplete({
// source: availableTags
});
}
}
})
app.controller('cnt',function($scope){
$scope.availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
})