I am trying to use the jQuery auto-complete widget by using the class attribute of an element which is dynamically created using ng-repeat. So far it's not working for dynamically created elements.
What I have tried so far is:
When I apply it on static created input box, it works properly.
angularcontroller.js
$('.auto').autocomplete({
source: function(request, response) {
$.ajax({
url: "/auto",
type: "GET",
data: request, // request is the value of search input
success: function (data) {
// console.log("data>>>"+JSON.stringify(data));
// Map response values to fiedl label and value
response($.map(data, function (el) {
return {
value: el.name,
label: el.name
};
}));
}
});
}
})
html file
<tr ng-repeat="rowContent in dataRows" style="text-align:center">
<td>
<input type="text" width="80px">
</td>
</tr>