title: angularjs scope variable is not updating in routeChangeSuccess
body: <p>AngularJs starting point app.js </p>
  
  <pre><code>.config(function ($routeProvider,$interpolateProvider,$locationProvider) {
  $routeProvider
    .when('/', {
      templateUrl: 'views/main.html',
      controller: 'MainCtrl'
    })
    .when('/page/:pageid', {
      templateUrl: function (params) {
                          return 'views/' + params.pageid + 'detail.html'; 
                                                  },
      controller: 'PageCtrl'
    }).
   .otherwise({
      redirectTo: '/'
    });
  </code></pre>
  
  <p>PageCtrl Js file</p>
  
  <pre><code> .controller('PageCtrl', function ($scope,$http,$timeout,$location,$rootScope,$filter) {
  
      $scope.currentrouteinPageCtrl = "";
  
      $scope.$on('$routeChangeSuccess', function (scope, next, current)
          {
               console.log('Total ......route slug : ' + Object.keys(next.params).length);
               console.log(next.params.pageid);
  
               $scope.currentrouteinPageCtrl = next.params.pageid; 
               console.log($scope.currentrouteinPageCtrl);
          });
  
          $( window ).scroll(function() 
          {
              console.log($scope.currentrouteinPageCtrl); 
  
          });     
  
  
   });
  </code></pre>
  
  <p>when i change my route dynamically like /page/food and than /page/story<br>
  <code>$scope.currentrouteinPageCtrl</code> is taking both value food and story in window scroll event               </p>
  
  <p>i thought there is no need of that stil, i tried <code>$scope.apply()</code> that give me digest error so i tried this <code>$rootScope.$$phase || $rootScope.$apply();</code> </p>
  
  <p>i also tried to get path from $location.path() but still facing same issue </p>
  
  <p>thanks in advance </p>