diff options
Diffstat (limited to 'client/src/app/videos/recommendations')
-rw-r--r-- | client/src/app/videos/recommendations/recommended-videos.component.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/client/src/app/videos/recommendations/recommended-videos.component.ts b/client/src/app/videos/recommendations/recommended-videos.component.ts index 68fd750cc..7e0fb8856 100644 --- a/client/src/app/videos/recommendations/recommended-videos.component.ts +++ b/client/src/app/videos/recommendations/recommended-videos.component.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Component, Input, OnChanges } from '@angular/core' | 1 | import { Component, Input, Output, OnChanges, EventEmitter } from '@angular/core' |
2 | import { Observable } from 'rxjs' | 2 | import { Observable } from 'rxjs' |
3 | import { Video } from '@app/shared/video/video.model' | 3 | import { Video } from '@app/shared/video/video.model' |
4 | import { RecommendationInfo } from '@app/shared/video/recommendation-info.model' | 4 | import { RecommendationInfo } from '@app/shared/video/recommendation-info.model' |
@@ -12,6 +12,7 @@ import { User } from '@app/shared' | |||
12 | export class RecommendedVideosComponent implements OnChanges { | 12 | export class RecommendedVideosComponent implements OnChanges { |
13 | @Input() inputRecommendation: RecommendationInfo | 13 | @Input() inputRecommendation: RecommendationInfo |
14 | @Input() user: User | 14 | @Input() user: User |
15 | @Output() gotRecommendations = new EventEmitter<Video[]>() | ||
15 | 16 | ||
16 | readonly hasVideos$: Observable<boolean> | 17 | readonly hasVideos$: Observable<boolean> |
17 | readonly videos$: Observable<Video[]> | 18 | readonly videos$: Observable<Video[]> |
@@ -21,6 +22,7 @@ export class RecommendedVideosComponent implements OnChanges { | |||
21 | ) { | 22 | ) { |
22 | this.videos$ = this.store.recommendations$ | 23 | this.videos$ = this.store.recommendations$ |
23 | this.hasVideos$ = this.store.hasRecommendations$ | 24 | this.hasVideos$ = this.store.hasRecommendations$ |
25 | this.videos$.subscribe(videos => this.gotRecommendations.emit(videos)) | ||
24 | } | 26 | } |
25 | 27 | ||
26 | public ngOnChanges (): void { | 28 | public ngOnChanges (): void { |