title: Angular Route - Call function on load
body: <p>I am using <code>$routeProvider</code> to route all of my apps pages to the correlating <code>controllers</code>, but when two <code>routes</code> use the same <code>controllers</code> (i.e. /blog &amp; /blog:id) how can I initialize a separate <code>function</code> depending on the current <code>route</code>.</p>
  
  <p>So if the route is /blog I want to initialize $scope.loadPosts() on route load.
  If the route is /blog:id I want to initialize $scope.loadPost($id) on route load.</p>