import { Component , OnInit } from '@angular/core' ; import { ActivatedRoute , Router } from '@angular/router' ; import { ArticleListConfig , Profile } from '../core' ; @ Component ( { selector : 'app-profile-favorites' , templateUrl : './profile-favorites.component.html' } ) export class ProfileFavoritesComponent implements OnInit { constructor ( private route , private router ) { } profile : Profile ; favoritesConfig : ArticleListConfig = { type : 'all' , filters : { } } ; ngOnInit ( ) { this . route . parent . data . subscribe ( ( data ) => { this . profile = data . profile ; this . favoritesConfig . filters . favorited = this . profile . username ; } ) ; } }