title: How to select the specific record from Observable in angular2
body: <p>Here is my Role class</p>
  
  <pre><code>export class Role {
      id: number;
      name: string;
  
      constructor(id: number, name: string) {
          this.id = id;
          this.name = name;
      }
  }
  </code></pre>
  
  <p>I have <code>roles</code></p>
  
  <pre><code>roles: Observable&lt;Role[]&gt;;
  </code></pre>
  
  <p>and I am filling with </p>
  
  <pre><code>this.roles = this.roleService.getAllRoles();
  </code></pre>
  
  <p>Now I want to filter the roles based on <code>id</code>. For this, I am using</p>
  
  <pre><code>let selectedRole = this.roles.filter(role =&gt; role.id === group.role)
                                 .map(role=&gt; {console.log(role)});
  </code></pre>
  
  <p>but this is not logging anything :(. Am I missing something? I have just started Angular2</p>