title: Angular 2 TypeScript how to find element in Array
body: <p>I have a Component and a Service:</p>
  <p>Component:
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export class WebUserProfileViewComponent {
      persons: Person [];
      personId: number;
      constructor( params: RouteParams, private personService: PersonService) {
            
          
             this.personId = params.get('id');
             this.persons =  this. personService.getPersons();
             console.log(this.personId);  
          }
  }</code></pre>
  </div>
  </div>
  </p>
  <p>Service:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>@Injectable()
  export class PersonService {
        getPersons(){
          var persons: Person[] = [
              {id: 1, firstName:'Hans', lastName:'Mustermann', email: 'mustermann@test.com', company:'Test', country:'DE'},
              {id: 2, firstName:'Muster', lastName:'Mustermann', email: 'mustermann@test.com', company:'test', country:'DE'},
              {id:3, firstName:'Thomas', lastName:'Mustermann', email: 'mustermannt@tesrt.com', company:'test', country:'DE'}
          ];
            
          return persons;
        }
  }</code></pre>
  </div>
  </div>
  </p>
  <p>I want to get the Person item with the ID ('personID'). The personID I get from <code>Routeparams</code>. For that I need the foreach loop? But I haven't found a solution for this.</p>