Currently, I have an Angular.js page that allows searching and displays the results. User clicks on a search result, then clicks the back button. I want the search results to be displayed again but I can't work out how to trigger the search to execute. Here are the details:
My Angular.js page is a search page, with a search field and a search button. The user can manually type in a query and press a button and ajax query is fired and the results are displayed. I update the URL with the search term. That all works fine.
User clicks on a result of the search and is taken to a different page - that works fine too.
User clicks the back button and goes back to my angular search page, and the correct URL is displayed, including the search term. All works fine.
I have bound the search field value to the search term in the URL, so it contains the expected search term. All works fine.
How do I get the search function to execute again without the user having to press the "Search'' button ``? If it was jquery then I would execute a function in the document ready function. I can't see the Angular.js equivalent.