title: Angularjs ui-router changes state but does not update url when passing params
body: <p>I am using UI-Router to navigate to detailed view. It changes state correctly and passes parameters correctly, yet the url address in the browser stays unchanged. I would like to display the passed params in the url.</p>
  
  <p>app.js </p>
  
  <pre><code>'use strict';
  
  var myApp = angular.module("myApp", ['ui.router']);
  
  myApp.config(['$stateProvider', '$urlRouterProvider','$locationProvider',
         function($stateProvider, $urlRouterProvider,$locationProvider) {
  
  
  $urlRouterProvider.otherwise('/');
  
  $stateProvider
  
  .state('/', {
  url: '/',
  templateUrl: 'partials/listView.html'
  })
  
  .state('list', {
      url: '/',
      templateUrl: 'partials/listView.html'
  })
  .state('detail', {
      url: '/detail/:key',
      params: {
           key: { value: "" }
      },
      templateUrl: 'partials/detailView.html',
      controller: 'DetailController'
  })
  
  // use the HTML5 History API
   $locationProvider.html5Mode(true); 
   }]);
  </code></pre>
  
  <p>Controller function to go to the detail state:</p>
  
  <pre><code>myApp.controller('MainContr', [ '$scope', '$http', '$location', '$state',
      '$filter','$rootScope', MainContr ]);
  
  function MainContr($scope, $http, $location, $state, $filter,$rootScope) {
  
  $scope.goDetailView= function(key){
      console.log("trying to change url ");
  
    // changes state correctly, and passes params to DetailController,  
   // but does not change browser address url. 
   // How can I update the url in browser here?
      $state.go('detail', 
              {key: $scope.selectedPDFKey},
              {
                  location:true
               });        
     }
  }
  
  // detail view
  myApp.controller('DetailController', [ '$scope', '$stateParams'
      DetailController ]);
  
  function PDFDetailController($scope,$state) 
  {
    $scope.currentKey=$state.params.key;
  }
  </code></pre>
  
  <p>If I remove <code>params</code> in <code>$state.go('detail')</code>, the url in browser address bar is replaced.  How can I get url in browser address bar replaced as well when I pass parameters in $state.go(). Thank you. </p>