title: How to execute AngularJS controller function on page load?
body: <p>Currently I have an Angular.js page that allows searching and displays results. User clicks on a search result, then clicks 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's the detail:</p>
  
  <ul>
  <li>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
  and ajax query is fired and the results are displayed.  I update the URL with the search term. That all works fine.</li>
  <li>User clicks on a result of the search and is taken to a different page - that works fine too. </li>
  <li>User clicks back button, and goes back to my angular search page, and the correct URL is displayed, including the search term. All works fine.</li>
  <li>I have bound the search field value to the search term in the URL, so it contains the expected search term. All works fine.</li>
  </ul>
  
  <p>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 documentready function. I can't see the Angular.js equivalent.</p>