title: Argument of type 'number' is not assignable to parameter of type 'string' in angular2.
body: <p>I have been building an angular2 application using this api : <a href="https://api.coinmarketcap.com/v1/ticker/" rel="nofollow noreferrer">https://api.coinmarketcap.com/v1/ticker/</a></p>
  
  <p>This api returns an array of dictionaries (sample): </p>
  
  <pre><code>[
  {
      "id": "bitcoin",     &lt;------ Wanna use this id
      "name": "Bitcoin", 
      "symbol": "BTC", 
      "rank": "1", 
      "price_usd": "9347.32", 
      "price_btc": "1.0", 
      "24h_volume_usd": "7926060000.0", 
      "market_cap_usd": "158936099373", 
      "available_supply": "17003387.0", 
      "total_supply": "17003387.0", 
      "max_supply": "21000000.0", 
      "percent_change_1h": "-0.24", 
      "percent_change_24h": "1.1", 
      "percent_change_7d": "6.62", 
      "last_updated": "1524926675"
  }, 
  </code></pre>
  
  <p>I am using routing parameters to go to a different page like this:   </p>
  
  <pre><code>&lt;tr *ngFor="let curr of currency" [routerLink]="['/currdetail',curr.id]"&gt;    &lt;------ Here 
        &lt;th scope="row"&gt;{{ curr.rank }}&lt;/th&gt;
        &lt;td&gt;{{curr.name}}&lt;/td&gt;
        &lt;td&gt;{{curr.symbol}}&lt;/td&gt;
        &lt;td&gt;{{curr.market_cap_usd}}&lt;/td&gt;
        &lt;td&gt;{{curr.price_usd}}&lt;/td&gt;
        &lt;td&gt;{{curr.price_btc}} &lt;/td&gt;
        &lt;td&gt;{{curr.available_supply}} &lt;/td&gt;
        &lt;td&gt;{{curr['24h_volume_usd']}} &lt;/td&gt;
        &lt;td&gt;{{curr.percent_change_1h}} &lt;/td&gt;
        &lt;td&gt;{{curr.percent_change_24h}}&lt;/td&gt;
        &lt;td&gt;{{curr.percent_change_7d}} &lt;/td&gt;
      &lt;/tr&gt;
  </code></pre>
  
  <p>Now i have written routes like this and included in my routing module:</p>
  
  <pre><code>export const routes: Routes = [
      { path: 'table',  component: TableComponent },
      { path: 'currdetail/:id',     component: CurrdetailComponent },
      { path: '', redirectTo: '/table', pathMatch: 'full' },
  ];
  </code></pre>
  
  <p>Currdetail component looks like this: </p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { CrypdataService } from '../crypdata.service'
  import { Params, ActivatedRoute } from '@angular/router';
  import { Location } from '@angular/common';
  
  @Component({
    selector: 'app-currdetail',
    templateUrl: './currdetail.component.html',
    styleUrls: ['./currdetail.component.css'],
    providers: [CrypdataService],
  })
  export class CurrdetailComponent implements OnInit {
  
    private curr;
  
    constructor(private crypdataservice: CrypdataService, private route: ActivatedRoute, private location: Location) { }
  
    ngOnInit() {
    let id = +this.route.snapshot.params['id'];
    this.curr = this.crypdataservice.getcurr(id);
    }
  
    goBack(): void{
      this.location.back();
    }
  
  }
  </code></pre>
  
  <p>Here is the crypdataservice file: </p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { Http, Response } from '@angular/http';
  import 'rxjs/add/operator/map';
  
  @Injectable()
  export class CrypdataService {
  
    private baseUrl: string = 'https://api.coinmarketcap.com/v1/ticker/';
  
    constructor(private http: Http) { }
  
    getcurr(id : string){
        return this.http.get(`https://api.coinmarketcap.com/v1/ticker/`+id).map((res:Response) =&gt; res.json());
    }
  
    getall(){
        return this.http.get(`https://api.coinmarketcap.com/v1/ticker/`).map((res:Response) =&gt; res.json());
    }
  }
  </code></pre>
  
  <p>It gives the following error : </p>
  
  <pre><code>ERROR in src/app/currdetail/currdetail.component.ts(20,44): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
  </code></pre>
  
  <p>I never specified id as a number, so can't figure out what is going wrong. Thanks for reading.</p>
  
  <p>I want to use the api for details of the particular currency : 
  <a href="https://api.coinmarketcap.com/v1/ticker/bitcoin/" rel="nofollow noreferrer">https://api.coinmarketcap.com/v1/ticker/bitcoin/</a>  &lt;---- this is the id</p>