title: detect URL changes
body: <p>I know this question has been asked before, and I've actually found a few solutions that I've implemented. Unfortunately, I couldn't get what I wanted.</p>
  
  <p>I haven't done AngularJS before, and what I am trying to do is:</p>
  
  <ol>
  <li>Detect when the URL changes</li>
  <li>Do some processing depending on what the URL changed to</li>
  </ol>
  
  <p>2nd part is pretty much done. I have a function to call when the URL changes. Let's call it <strong>myFunction()</strong>.</p>
  
  <p>The <strong>html</strong> element of the site has 2 attributes: <strong>ng-controller</strong> and <strong>ng-app</strong>.</p>
  
  <p><em>ng-controller</em>: myCtrl</p>
  
  <p><em>ng-app</em>: myApp</p>
  
  <p>I have a JavaScript file loaded at the <strong>head</strong> element. What I ultimately want to do is to add some logic in that file to watch for URL changes.</p>
  
  <p>The last thing I've tried in Firebug was:</p>
  
  <pre><code>angular.module('myApp').controller("myCtrl", function($scope, $location, $rootScope, $log) {
    $rootScope.$on("$locationChangeStart", function(event, next, current) {
      $log.info("location changing to:" + next);
    });
  });
  </code></pre>
  
  <p>However, this does not log anything on URL change.</p>