title: $stateparams is not changing in the services Even if it changes outside the factory
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var routerApp = angular.module('routerApp', ['ui.router','ngResource']);
  
  routerApp.config(function($stateProvider, $urlRouterProvider) {
   
   
      $stateProvider
      // HOME STATES AND NESTED VIEWS 
        .state('partyDetail', {
           url: '/party/:partyID',
         templateUrl: 'hello.html',
          controller: function($scope, $stateParams, UserFactory) {
        
           $scope.id = $stateParams.partyID;
           console.log($stateParams.partyID);
           UserFactory.get({}, function (userFactory){
           $scope.userdata = userFactory.user;
            });
          }
         
      });
  });
  
  routerApp.controller('chappy',[function(){
   var thisOne=this;
   thisOne.note=[
    {id:1,Name:'emp.json',Status:false},
    {id:2,Name:'1',Status:true},
    {id:3, Name:'2',Status:false}
    ];
   console.log("I'm in controller");
   }]); 
  
  routerApp.factory('UserFactory', function ($resource,$stateParams) {
  console.log($stateParams.partyID);
   return $resource(':Id',{Id: $stateParams.partyID }, {
         query: {
         method: 'GET',
         params: {},
         isArray: true
          }
      })
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!-- index.html --&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;!-- CSS (load bootstrap) --&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"&gt;  
  
  &lt;!-- JS (load angular, ui-router, and our custom js file) --&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular.js"&gt;&lt;/script&gt;
  
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.15/angular-ui-router.js" &gt;&lt;/script&gt;
  
  &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular-resource.js"&gt;&lt;/script&gt;
  
  &lt;script src="app.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;!-- apply our angular app to our site --&gt;
  &lt;body ng-app="routerApp"&gt;
  &lt;!-- NAVIGATION --&gt;
  &lt;nav class="navbar navbar-inverse" role="navigation" ng-controller="chappy as chappu"&gt;
  
  &lt;ul class="nav navbar-nav" ng-repeat="result in chappu.note"&gt;
     
    
   &lt;li&gt;&lt;a ui-sref="partyDetail({ partyID: result.Name })" &gt;&lt;span ng-bind="result.Name"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/nav&gt;
  
  &lt;!-- MAIN CONTENT --&gt;
  &lt;div class="container"&gt;
   &lt;!-- THIS IS WHERE WE WILL INJECT OUR CONTENT ============================== --&gt;
   &lt;div ui-view&gt;&lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;!--partial html which is needed to be included in the ui-view--&gt;
  
  &lt;!--hello.html--&gt;
  &lt;div&gt;
  
   &lt;p &gt; what were you saying &lt;span ng-bind="id"&gt;&lt;/span&gt;&lt;/p&gt;
   &lt;p ng-repeat="result in userdata"&gt;
    &lt;span ng-bind="result.subject"&gt;&lt;/span&gt;
   &lt;/p&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/dpUcc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dpUcc.png" alt="enter image description here"></a>I have created Here a DemoApp in which I have dynamically Created The URi according to the data coming from the different Controller</p>
  
  <p>The Programs seems to work fine at the first glance but it has a problem that the $stateparams even After changes but in the URi it remains the same </p>
  
  <p>The issue here is that maybe my not  services is getting called again 
  but I am not been able to encounter this bug</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>var routerApp = angular.module('routerApp', ['ui.router','ngResource']);
  
  routerApp.config(function($stateProvider, $urlRouterProvider) {
  
  
      $stateProvider
      // HOME STATES AND NESTED VIEWS 
        .state('partyDetail', {
           url: '/party/:partyID',
  </code></pre>
  
  <p>The Console output clearly indicates that the Uri is same as it fetch the data for the first time</p>
  
  <p>Clearly, either factory is not getting called again or $stateparams is not changing</p>
  
  <p>help is appreciated  </p>