down votefavorite 
<http://stackoverflow.com/questions/43321058/get-url-parameters-angular-2-after/43321437?noredirect=1#>

I have a problem when i try to get parameters from the url, the value of 
access_token variable for example is undifined ?

Example of the url (from a callback) : 
http://localhost:4200/#access_token=1561651sdqs5dq5645646My code under the 
constructor :

router.events.subscribe(s => {
      if (s instanceof NavigationCancel) {
        
        let params = new URLSearchParams(s.url.split('#')[1]);
        let access_token = params.get('access_token');
        let code = params.get('code');
      }
    });

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to