ui-router 1.x.x change $transition$.params() during resolve : <p>Trying to migrate an angularjs application to use the new version of <code>angular-ui-router</code> 1.0.14 and stumbled upon a problem when trying to change <code>$stateParams</code> in the resolve of a state.</p>

<p>For example, previously (when using <code>angular-ui-router</code> 0.3.2) modifying <code>$stateParams</code> worked like this:</p>

<pre><code> $stateProvider.state('myState', {
   parent: 'baseState',
   url: '/calendar?firstAvailableDate',
   template: 'calendar.html',
   controller: 'CalendarController',
   controllerAs: 'calendarCtrl',
   resolve: {
     availableDates: ['CalendarService', '$stateParams', function(CalendarService, $stateParams) {
       return CalendarService.getAvailableDates().then(function(response){
          $stateParams.firstAvailableDate = response[0];
          return response;
       });
     }]
   }
 })
</code></pre>

<p>The problem is <code>firstAvailableDate</code> is populated after a resolve and I do not know how to update <code>$transition$.params()</code> during a resolve when usign the new version of <code>angular-ui-router</code> 1.0.14.</p>

<p>I have tried, and managed to update the url parameter with</p>

<ol>
<li><p>firing a <code>$state.go('myState', {firstAvailableDate : response[0]})</code> but this reloads the state, so the screen flickers</p></li>
<li><p>modified <code>$transition$.treeChanges().to[$transition$.treeChanges().length-1].paramValues.firstAvailableDate = response[0];</code> to actually override the parameters. I have done this after looking through the implementation on <code>params()</code> for <code>$transition$</code>.</p></li>
</ol>

<p>Although both those options work, they seem to be hacks rather than by the book implementations.</p>

<p>What is the correct approach to use when trying to modify parameters inside a resolve?</p>
