title: How to get param from url in angular 4?
body: <p>I'm trying to get startdate from the URL. 
  The URL looks like <code>http://sitename/booking?startdate=28-08-2017</code></p>
  
  <p>My code is below:</p>
  
  <p>aap.module.ts</p>
  
  <pre class="lang-js prettyprint-override"><code>    import {...};
  
      @NgModule({
        declarations: [
          AppComponent, ModalComponent
        ],
        imports: [
          BrowserModule,
          FormsModule,
          HttpModule,
          JsonpModule,
          ReactiveFormsModule,
          RouterModule.forRoot([{
                  path: '',
                  component: AppComponent
              },
          ]),    
        ], 
        providers: [ContactService, AddonService, MainService],
        bootstrap: [AppComponent]
      })
      export class AppModule { }
  </code></pre>
  
  <p>aap.component.ts</p>
  
  <pre class="lang-js prettyprint-override"><code>import {...}
  import {Router, ActivatedRoute, Params} from '@angular/router';
  
  constructor(private activatedRoute: ActivatedRoute) {
    // subscribe to router event
    this.activatedRoute.queryParams.subscribe((params: Params) =&gt; {
      console.log(params);
    });
  
  }
  </code></pre>
  
  <p>But its giving the below error </p>
  
  <blockquote>
    <p>Unhandeled Promise rejection: No base href set. Please provide a value
    for the APP_BASE_HREF token or add a base element to the document. ;
    Zone:  ; Task: Promise.then ; Value: Error: No base href set.
    Please provide a value for the APP_BASE_HREF token or add a base
    element to the document.</p>
  </blockquote>
  
  <p>How does Angular know the base href?</p>