title: How to call a function in AngularJs when route matches?
body: <pre><code>$routeProvider.when('/ticket', {
      controller: TicketController, 
      templateUrl: Routing.generate('ticket_list')
  });
  </code></pre>
  
  <p>displays a simple list where each entry is selectable. However on select no extra view is loaded. Every thing is in <code>ticket_lost template</code>. The template has some hidden fields that are revealed when entry is clicked.</p>
  
  <p>I can define which entry is selected internally by setting </p>
  
  <pre><code>selectedTicket = 1;
  </code></pre>
  
  <p>So when there is a route like</p>
  
  <pre><code>/ticket/1
  </code></pre>
  
  <p>I want to call a function that sets selectedTicket to 1. Is that possible? How to do that? What do I have to change in routing?</p>