import { Component , OnDestroy , OnInit } from '@angular/core' ; import { ActivatedRoute } from '@angular/router' ; import { BreadCrumbModel , ProjectModel , RepositoryModel } from '@app/shared/models/index.model' ; import { RepositoryService } from '@core/services/index.service' ; import { Subscription } from 'rxjs' ; /**
 * Repository rating component
 */ @ Component ( { selector : 'dashboard-rating' , templateUrl : './rating.component.html' , styleUrls : [ './rating.component.scss' ] , } ) export class RatingComponent implements OnInit , OnDestroy { private repositorySubscription : Subscription ; public project : ProjectModel ; public repository : RepositoryModel ; public breadCrumb : BreadCrumbModel [ ] ; param repositoryService param route constructor ( private repositoryService , private route ) { this . route . data . subscribe ( ( data ) => { this . repository = data . repository ; this . project = data . project ; this . breadCrumb = [ { link : `/projects/${ this . project . uid }` , title : this . project . title } ] ; } ) ; } /**
     * Life cycle init method
     */ ngOnInit ( ) { const repoUid = this . route . snapshot . paramMap . get ( 'repoUid' ) ; this . repositorySubscription = this . repositoryService . findOneById ( repoUid ) . subscribe ( ( repository ) => this . repository = repository ) ; } /**
     * Life cycle destroy method
     */ ngOnDestroy ( ) { this . repositorySubscription . unsubscribe ( ) ; } }