This AngularJs function works only when the page loads for the first time and when I refresh it will work and when I go to other page and come back to this page it will not work. I need this function to work even when I visit back from other pages. Is there any alternative?
angular.element(document).ready(function () {
$("#SearchBox1").autocomplete('/api/search/predicateNames', {
formType: "POST",
dataType: "json",
scroll: false,
matchSubset: false,
width: 300,
max: 10,
selectFirst: false,
cacheLength: 1,
formatItem: formatResultItem,
parse: parseResultData,
selectedRearch: selectedRearchForMobile
});
});