title: How do I parse URL params after a hash with Angularjs?
body: <p>I'm trying to parse for the access_token from Foursquare where the URL is like this:</p>
  
  <p><a href="https://mywebsite.com/4sqredirect/#access_token=1234567890XXXXX">https://mywebsite.com/4sqredirect/#access_token=1234567890XXXXX</a></p>
  
  <p>I've tried $routeParams and $location and get nothing returned.  Only after I tried $route, I did get an object back with the following attribute in it:</p>
  
  <pre><code>current:  { 
      params:  {  } 
      pathParams:  {  } 
      loadedTemplateUrl: partials/4sqredirect
      locals:  {  } 
      scope:  { 
          this:  { 
              $ref: $["current"]["scope"]
          } 
          route:  { 
              $ref: $
          } 
          location:  {  } 
          token: null
      }
  } 
  </code></pre>
  
  <p>Does this mean there's no way to get it using native AngularJS functions cause of the hash?</p>
  
  <p>UPDATE:</p>
  
  <p>my controller looks like as follows:</p>
  
  <pre><code>angular.module('myApp')
      .controller('4sqredirectCtrl', function ($scope, $route, $location, $routeParams) {
          $scope.route = $route;
          $scope.location = $location;
          $scope.token = $routeParams.access_token;
      });
  </code></pre>
  
  <p>my main js looks like as follows:</p>
  
  <pre><code>angular.module('myApp', [
      'ngCookies',
      'ngResource',
      'ngSanitize',
      'ngRoute'
  ])
  .config(function ($routeProvider, $locationProvider) {
      $locationProvider.html5Mode(true);
  
      $routeProvider
      .when('/', {
          templateUrl: 'partials/main',
          controller: 'MainCtrl'
      })
      .when('/4sqredirect/', {
          templateUrl: 'partials/4sqredirect',
          controller: '4sqredirectCtrl'
      })
      .otherwise({
          redirectTo: '/'
      });
  });
  </code></pre>