title: Angular 4 get queryString
body: <p>Making an angular onboarding page for a corporate website. People will navigate to the page via a link in a welcome email which will contain a user specific token. I need to get this token out of the url querystring and use it in all ajax calls for auth purposes. My problem is reading the querystring.</p>
  
  <p>Angular version is 4.2.4</p>
  
  <p>I have combed through pages of docs on the '@angular/common' Location, LocationStrategy, PathLocationStrategy and have copy pasted the import and adding them to the providers, I get error after error after error. I can't find a simple example anywhere of importing location and using it to get the querystring from the page url. If this were javascript it's a super simple couple lines of code. Why is this so difficult? Any help would be greatly appreciated!</p>
  
  <p>What I tried:</p>
  
  <p><strong>app.module.ts</strong></p>
  
  <pre><code>import { Location, LocationStrategy, PathLocationStrategy } from '@angular/common';
  
  providers: [Location, {provide: LocationStrategy, useClass: PathLocationStrategy}],
  </code></pre>
  
  <p><strong>page.services.ts</strong></p>
  
  <pre><code>constructor(private location: Location) {
    console.log('location: ', location);
  }
  </code></pre>