title: Angular2 Query Parameter from index URL
body: <p>I am trying to get the query params from a url in a component in Angular2</p>
  
  <p>Version:  "angular2": "npm:angular2@2.0.0-beta.12",</p>
  
  <p>I am trying to extract id query param in the component and display it</p>
  
  <p>Here is the request. </p>
  
  <p>localhost:8080/index.html?id=1</p>
  
  <p>boot.ts</p>
  
  <pre><code>import 'reflect-metadata';
  import 'angular2/bundles/angular2-polyfills';
  import { bootstrap } from 'angular2/platform/browser';
  import { provide} from 'angular2/core';
  import { AppComponent } from './app.component';
  import {ROUTER_PROVIDERS, Location, LocationStrategy,     HashLocationStrategy} from "angular2/router";
  import {HTTP_PROVIDERS} from "angular2/http";
  
  bootstrap(AppComponent , [ROUTER_PROVIDERS, HTTP_PROVIDERS, provide(LocationStrategy, {useClass: HashLocationStrategy})]);
  </code></pre>
  
  <p>Here is app.component.ts</p>
  
  <pre><code>import { Component } from 'angular2/core';
   import {Router, Location, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig, RouteParams} from 'angular2/router';
  
  @Component({
      selector: 'my-app',
      template: '{{welcome}} {{queryParam}}',
      directives: [ROUTER_DIRECTIVES]
  })
  export class AppComponent {
      welcome: string = 'Query Param test!'
      queryParam : string;
  
      constructor(private _location: Location, private _routeParams:     RouteParams){
          console.log(_routeParams.get('id'));
          this.queryParam = _routeParams.get('id');
      }
  
  }
  </code></pre>
  
  <p>I keep getting this error:</p>
  
  <p><a href="http://i.stack.imgur.com/kenI3.png" rel="nofollow">error message</a></p>
  
  <p>I got this solution from another post.  Not sure how to fix the error</p>
  
  <p>A</p>