import { ChangeDetectionStrategy , Component , Inject } from '@angular/core' ; import { MAT_DIALOG_DATA , MatDialogRef } from '@angular/material/dialog' ; import { getAlbumCover } from '../shared' ; export interface IInfoDialogData { playlist : SpotifyApi . SinglePlaylistResponse ; playlistLength : number ; } @ Component ( { selector : 'sort-info-dialog' , templateUrl : './info-dialog.component.html' , styleUrls : [ './info-dialog.component.scss' ] , changeDetection : ChangeDetectionStrategy . OnPush , } ) export class InfoDialogComponent { constructor ( private dialogRef , @ Inject ( MAT_DIALOG_DATA ) public data ) { } get albumCover ( ) : string { return getAlbumCover ( this . data . playlist , true ) ; } cancel ( ) { this . dialogRef . close ( false ) ; } }