I am working on a AngularJs based SPA. Search box has a autocomplete function which is not working properly. When I start typing in the search box, typed string appears in {{search.name}} and suggestion come in but when I click on one of the suggestion it doesn't appear in {{search.name}}.After that if any other button is pressed string appears.
This is my html code
<div class=" upper-one">
<div class="search-box" style="display:inline;">
<img src="img/search.png" width="28px" height="28px" style="float:left;">
<input id="tags" class="input-search-box" type="text" placeholder="Start typing " data-ng-model="search.name"></input>
<a> <div class="go-class" style="position:relative;" data-ng-click="searchProduct()"> Go</div> </a>
</div>
{{search.name}
</div>
This is my jquery code
<script >
$(function() {
var availableTags =["Jquery","Html","Css"
];
$( "#tags" ).autocomplete({
source: availableTags
});
});
</script>
What is wrong with my code?