How do I parse URL params after a hash with Angularjs?

后端 未结 4 1298
挽巷
挽巷 2020-12-29 06:36

I\'m trying to parse for the access_token from Foursquare where the URL is like this:

https://mywebsite.com/4sqredirect/#access_token=1234567890XXXXX

I\'ve t

4条回答
  •  失恋的感觉
    2020-12-29 07:05

    There is in fact no direct support from Angular JS to do this. I wouldn't use ngRoute, because it already might expect the # at a different place. A simple solution to your problem is to use the location.hash and the substring() function:

    
    
    
    
    
    
    
    
    
    
    

    Access Token

    {{accessToken}}

提交回复
热议问题