title: Angular UI Router remove slash in ? parameter
body: <p>Currently I have this issue: <a href="https://stackoverflow.com/questions/42254388/angular-ui-route-stateparam-in-substate/42254721">Angular ui route stateparam in substate</a></p>
  
  <p>After some tries with route params and other methods in the url of the state like <code>{transactionid}</code> and <code>[transactionid]</code> I noticed that there is an / added before the ? of the parameter. So, the URL look liks:</p>
  
  <pre><code>website.com/page/?transactionid=someid
  </code></pre>
  
  <p>but, I think it must be</p>
  
  <pre><code>website.com/page?transactionid=someid
  </code></pre>
  
  <p>We currently remove the trailing slash of any url using this code</p>
  
  <pre><code>$urlMatcherFactoryProvider.strictMode(false);
  
  $urlRouterProvider.rule(function($injector, $location) {
      var path = $location.path();
      var hasTrailingSlash = path[path.length-1] === '/';
  
      if(hasTrailingSlash) {
          //if last charcter is a slash, return the same url without the slash  
          var newPath = path.substr(0, path.length - 1); 
          return newPath; 
      }
  });
  </code></pre>
  
  <p>But, how can I remove the '/' before an 'question' mark? </p>
  
  <p>The route for 'payment-success' (see question in link) currently looks like:</p>
  
  <pre><code>.state('shop.payment-success', {
      url: '/payment-success{transactionid}',
      templateUrl: '/views/payment-success.html',
      params: {
          transactionid: {
              value: null,
              squash: true
          }
      },
      resolve: {
          transactionid: ['$stateParams', function($stateParams){
              console.log($stateParams);
              return $stateParams.transactionid
          }]
      }
  </code></pre>