import { Component , OnInit } from '@angular/core' ; import { Observable } from 'rxjs' ; import { map } from 'rxjs/operators' ; import { GithubService } from '../github.service' ; import { Repository } from '../repository' ; @ Component ( { selector : 'app-repositories' , templateUrl : './repositories.component.html' , styleUrls : [ './repositories.component.scss' ] } ) export class RepositoriesComponent implements OnInit { repos$ : Observable < Repository [ ] > | undefined ; constructor ( private githubService ) { } ngOnInit ( ) { this . repos$ = this . githubService . getRepos ( ) . pipe ( map ( repos => repos . filter ( repo => ! repo . fork ) ) ) ; } }