title: AngularJS anchorScroll not scrolling , ui-router
body: <p>I am using ui-router and i am trying to scroll automatically in the controller.
  However anchorScroll seems to do nothing, my guess is that it doesn't like two # in the URL.</p>
  
  <p>Example:</p>
  
  <p>index.php#/initiative/1/commentscroll/4</p>
  
  <p>turns into:</p>
  
  <p>index.php#/initiative/1/commentscroll/4#comment-id-4</p>
  
  <p>But the scrolling isn't done (and yes the anchors actually exist ;)</p>
  
  <p>Any ideas?</p>
  
  <pre><code>controllersModule.controller('InitiativeController', ['$http','$timeout','$location','$state','services','$stateParams','$anchorScroll', function($http,$timeout,$location,$state,services,$stateParams,$anchorScroll){
  var pk = this;
  pk.initiative={};
  
  if($state.current.url.indexOf("/commentscroll/")!=1){
      $timeout(function() {
          $location.hash('comment-id-'+$stateParams.commentId);
          $anchorScroll();
      });
  }
  
  
  services.get($stateParams.initiativeId,'initiative','').then(function(data){
      pk.initiative=data;
  
  });
  
  function fillScrollId(element,index,array){
      if(element.initiative_comment_id===$stateParams.commentId){
          element.scrollToMe="yes";
      }
      if(element.comments.length&gt;0){
          element.comments.forEach(fillScrollId);
      }
  }
  }]);
  </code></pre>