title: Not scrolling to indicated position in rebuilt page
body: <p>I am trying to scroll to a specific place in my (newly built) page from the (same) page (with different content). AngularJS builds the new page, but doesn't scroll (at all) down to the desired location.</p>
  
  <p>I have a page, <em>./index.html</em>, that, depending on links clicked, loads content from one of many individual, simple HTML files. Internally to any given content, I can create references between locations using a function, <em>gotoLocation()</em> and these work. However, scrolling to a location deep inside another content does not work, only that content is loaded and its top is displayed.</p>
  
  <p>For example, in <em>./glossary.html</em> is:</p>
  
  <pre><code>|p|
  Here is an "internal" hypertext link to go to
  |a href="" ng-click="gotoLocation( 'relationship' )"||i|relationship|/i||/a|
  in the Glossary.
  |/p|
  .
  .
  .
  |a id="relationship"||/a|
  |p|
  relationship - the quality of a connection colored as "success", "failure"
  or any other designation as conceived by the processor's author.
  |/p|
  </code></pre>
  
  <p>And, when the glossary is loaded, clicking on that link does scroll down to the desired location. But, if that link is in another content (say, <em>./concepts.html</em>), I still wish it to land down inside the glossary (<em>./glossary.html</em>), so I do this in <em>./concepts.html</em>:</p>
  
  <pre><code>|p|
  Here is an "external" hypertext link to go to
  |a href="" ng-click="gotoPageAndLocation( './glossary.html', 'relationship' )"|
  |i|relationship|/i||/a| in the Glossary on a "different" page (that is, in
  different content than the content this link is in).
  |/p|
  </code></pre>
  
  <p>The JS functions I have are:</p>
  
  <pre><code>angular.module( 'anchorScrollModule', [] )
  .controller( 'ScrollController', [ '$scope', '$location', '$anchorScroll',
  '$http', '$timeout',
  function( $scope, $location, $anchorScroll, $http, $timeout )
  {
      $scope.gotoLocation = function( where )
      {
        $location.hash( where );
        $anchorScroll();
      }
  
      $scope.gotoPage = function( page )
      {
        $scope.filepath = page;
      }
  
      $scope.gotoPageAndLocation = function( page, where )
      {
        $scope.filepath = page;
  
        waitForRenderAndGotoReference( where );
      }
  
      /* Wait for the AngularJS digest cycle. See
       * http://tech.endeepak.com/blog/2014/05/03/waiting-for-angularjs-digest-cycle/
       * (However, pendingRequests.length is always 0 anyway!!!!)
       */
      waitForRenderAndGotoReference = function( where )
      {
        console.log( "Pending requests length: " + $http.pendingRequests.length );
  
        if( $http.pendingRequests.length &gt; 0 )
        {
           $timeout( waitForRenderAndGotoReference( where ) );
        }
        else
        {
           $location.hash( where );
           $anchorScroll();
        }
      }
  }]);
  </code></pre>