title: Passing Parameter to Angular2 Component
body: <p>I'm Learning Angular2 so be gentle... I have a basic Component which has a string array. I want to pass an integer to this component and have it return the string found at the index of that parameter.</p>
  
  <p>E.g. myComponent[number]=1 returns string "second element".</p>
  
  <p>My code so far is this:</p>
  
  <pre><code>import { Component } from '@angular/core';
  
  @Component({
    selector: 'myComponent',
    template: 
      `&lt;h1&gt;Returned Value {{returnedString}}&lt;/h1&gt;,`, 
    inputs:['number']
  })
  export class MyComponent  { 
    myStringArray: string[]; 
    returnedString: string;
  
    constructor(){
      this.myStringArray = ['First','Second','Third','Forth','Fifth','Sixth'];
      this.returnedString = 'number'+this.myStringArray['number'.valueOf()];
    }
  }
  </code></pre>
  
  <p>I am calling this component as follows </p>
  
  <pre><code>&lt;myComponent [number]=1&gt;&lt;/myComponent&gt;
  </code></pre>
  
  <p>I print the value returned to the screen and get 'undefined'.</p>
  
  <p>Any ideas folks?</p>