title: angular ui router places query string before hash
body: <p>I have an application that uses an external payment provider to buy credits. After a successful purchase the payment provider redirects to <code>http://any.url/?orderNr=xxxx&amp;outcome=SUCCESS</code>. This url is an AngularJS application that makes use of UI Router. The configuration of the router is this:</p>
  
  <pre><code>$stateProvider
      .state('dashboard', {
          url: '/dashboard',
          templateUrl: 'views/dashboard.html',
          controller: 'DashboardCtrl',
          isAuthenticated: true
      })
      .state('login', {
          url: '/login',
          templateUrl: 'views/login.html',
          controller: 'LoginCtrl',
          isAuthenticated: false
          });
  
  $urlRouterProvider.otherwise('/login');
  </code></pre>
  
  <p>So when the user comes back to the root of <code>http://any.url</code> and has already been logged in it redirects to the dashboard. This is the case after a payment because you cannot make payments without logging in. The problem is that the hashbang is placed after the query string, so the url of the dashboard becomes <code>http://any.url/?orderNr=xxxx&amp;outcome=SUCCESS#/dashboard</code>. In the <code>DashboardCtrl</code> I'm unable to get the query string using <code>$location.search()</code>. Is there any way to get the query string the 'angular way', so not by parsing <code>location.href</code> ??</p>