docs: fix jsdoc comments for improved documentation accuracy

This commit is contained in:
Chneemann 2025-05-05 08:10:24 +02:00
parent 3f5d397dfa
commit de381bf5b9
16 changed files with 44 additions and 24 deletions

View file

@ -1,6 +1,5 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router'; import { RouterOutlet } from '@angular/router';
import { ErrorToastComponent } from './shared/components/error-toast/error-toast.component';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
@ -10,5 +9,5 @@ import { ErrorToastComponent } from './shared/components/error-toast/error-toast
styleUrl: './app.component.scss', styleUrl: './app.component.scss',
}) })
export class AppComponent { export class AppComponent {
title = 'frontend'; title = 'Videoflix - Frontend';
} }

View file

@ -14,6 +14,10 @@ import { ErrorService } from '../../../services/error.service';
styleUrl: './forgot-password.component.scss', styleUrl: './forgot-password.component.scss',
}) })
export class ForgotPasswordComponent implements OnInit { export class ForgotPasswordComponent implements OnInit {
sendMailSuccess: boolean = false;
queryEmail: boolean = false;
queryEmailSuccess: boolean = false;
authData = { authData = {
mail: '', mail: '',
token: '', token: '',
@ -22,12 +26,8 @@ export class ForgotPasswordComponent implements OnInit {
send: false, send: false,
}; };
sendMailSuccess: boolean = false;
queryEmail: boolean = false;
queryEmailSuccess: boolean = false;
/** /**
* Initializes the VerifyEmailComponent with ActivatedRoute, AuthService, and ErrorService. * Initializes the ForgotPasswordComponent with ActivatedRoute, AuthService, and ErrorService.
*/ */
constructor( constructor(
private route: ActivatedRoute, private route: ActivatedRoute,

View file

@ -25,7 +25,7 @@ export class RegisterComponent implements OnInit {
}; };
/** /**
* Initializes the LoginComponent with ActivatedRoute, AuthService, and ErrorService. * Initializes the RegisterComponent with ActivatedRoute, AuthService, and ErrorService.
*/ */
constructor( constructor(
private route: ActivatedRoute, private route: ActivatedRoute,

View file

@ -33,7 +33,7 @@ export class CategoriesComponent implements AfterViewInit {
genres$ = this.genreService.getGenres(); genres$ = this.genreService.getGenres();
/** /**
* Initializes the HomeComponent with the GenreService. * Initializes the CategoriesComponent with the GenreService.
*/ */
constructor(private genreService: GenreService) {} constructor(private genreService: GenreService) {}

View file

@ -15,6 +15,7 @@ export class VideoListComponent {
@Input() currentVideo: Video | null = null; @Input() currentVideo: Video | null = null;
@Input() watchedVideos: any[] = []; @Input() watchedVideos: any[] = [];
@Input() videoCategory: string = ''; @Input() videoCategory: string = '';
@Output() currentVideoId = new EventEmitter<number>(); @Output() currentVideoId = new EventEmitter<number>();
/** /**

View file

@ -51,7 +51,8 @@ export class HeroBannerComponent implements OnChanges {
videoIsUploaded: { [resolution: string]: boolean }; videoIsUploaded: { [resolution: string]: boolean };
/** /**
* Initializes the HomeComponent with the VideoService, ResolutionService and UserService. * Initializes the HeroBannerComponent with the VideoService, ResolutionService and UserService.
* Gets the available resolutions and video upload status.
*/ */
constructor( constructor(
private videoService: VideoService, private videoService: VideoService,

View file

@ -46,6 +46,7 @@ export class HomeComponent implements OnInit {
/** /**
* Initializes the HomeComponent with the VideoService, UserService and ResolutionService. * Initializes the HomeComponent with the VideoService, UserService and ResolutionService.
* Get the available resolutions, current resolution, and video upload status.
*/ */
constructor( constructor(
private videoService: VideoService, private videoService: VideoService,

View file

@ -41,7 +41,7 @@ export class UploadVideoComponent {
genres$ = this.genreService.getGenres(); genres$ = this.genreService.getGenres();
/** /**
* Initializes the HomeComponent with the ErrorService, VideoService and GenreService. * Initializes the UploadVideoComponent with the ErrorService, VideoService and GenreService.
*/ */
constructor( constructor(
public errorService: ErrorService, public errorService: ErrorService,

View file

@ -18,11 +18,8 @@ export class VideoPlayerComponent implements OnInit, OnDestroy {
private defaultResolution: string; private defaultResolution: string;
/** /**
* Creates a new instance of the VideoPlayerComponent and sets the default * Initializes the VideoPlayerComponent with the ElementRef and ResolutionService.
* resolution by fetching it from the ResolutionService. * Get the default resolution.
*
* @param elementRef A reference to the DOM element which hosts the video player.
* @param resolutionService A service which provides the available resolutions.
*/ */
constructor( constructor(
private elementRef: ElementRef, private elementRef: ElementRef,

View file

@ -8,7 +8,10 @@ import { AuthService } from '../services/auth.service';
providedIn: 'root', providedIn: 'root',
}) })
export class AuthGuard { export class AuthGuard {
constructor(private authService: AuthService, private router: Router) {} /**
* Initializes the AuthGuard with Router and AuthService.
*/
constructor(private router: Router, private authService: AuthService) {}
/** /**
* Determines if the route can be activated by checking if the user is authenticated. * Determines if the route can be activated by checking if the user is authenticated.

View file

@ -9,6 +9,9 @@ import { Genre } from '../interfaces/genre.interface';
export class GenreService { export class GenreService {
private genres: Genre[] = []; private genres: Genre[] = [];
/**
* Initializes the GenreService with ApiService.
*/
constructor(private apiService: ApiService) {} constructor(private apiService: ApiService) {}
/** /**

View file

@ -1,10 +1,9 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { catchError, filter, firstValueFrom, map, Observable, of } from 'rxjs'; import { catchError, firstValueFrom, map, Observable, of } from 'rxjs';
import { ApiService } from './api.service'; import { ApiService } from './api.service';
import { AuthService } from './auth.service'; import { AuthService } from './auth.service';
import { ResolutionService } from './resolution.service'; import { ResolutionService } from './resolution.service';
import { Video } from '../interfaces/video.interface'; import { Video } from '../interfaces/video.interface';
import { HttpClient, HttpEvent, HttpEventType } from '@angular/common/http';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
@ -16,13 +15,10 @@ export class VideoService {
private availableResolutions: string[]; private availableResolutions: string[];
/** /**
* Initializes the VideoService with HttpClient,ApiService, AuthService, and ResolutionService * Initializes the VideoService with ApiService, AuthService, and ResolutionService
* * Get the available resolutions
* It fetches the available resolutions from the ResolutionService and stores
* them in the availableResolutions field.
*/ */
constructor( constructor(
private http: HttpClient,
private apiService: ApiService, private apiService: ApiService,
private authService: AuthService, private authService: AuthService,
private resolutionService: ResolutionService private resolutionService: ResolutionService

View file

@ -11,6 +11,9 @@ import { ErrorService } from '../../../services/error.service';
export class ErrorToastComponent implements OnInit { export class ErrorToastComponent implements OnInit {
errorText: string = ''; errorText: string = '';
/**
* Initializes the ErrorToastComponent with ErrorService.
*/
constructor(private errorService: ErrorService) {} constructor(private errorService: ErrorService) {}
/** /**

View file

@ -13,8 +13,12 @@ import { TokenService } from '../../../services/token.service';
}) })
export class HeaderComponent { export class HeaderComponent {
@Input() showFullLogo: boolean = true; @Input() showFullLogo: boolean = true;
@Output() videosChange = new EventEmitter<any[]>(); @Output() videosChange = new EventEmitter<any[]>();
/**
* Initializes the HeaderComponent with AuthService and TokenService.
*/
constructor( constructor(
private authService: AuthService, private authService: AuthService,
private tokenService: TokenService private tokenService: TokenService

View file

@ -9,8 +9,14 @@ import { CommonModule, Location } from '@angular/common';
styleUrl: './imprint.component.scss', styleUrl: './imprint.component.scss',
}) })
export class ImprintComponent { export class ImprintComponent {
/**
* Initializes the ImprintComponent with Location.
*/
constructor(private location: Location) {} constructor(private location: Location) {}
/**
* Navigate back to the previous page.
*/
backClicked() { backClicked() {
this.location.back(); this.location.back();
} }

View file

@ -9,8 +9,14 @@ import { CommonModule, Location } from '@angular/common';
styleUrl: './privacy-policy.component.scss', styleUrl: './privacy-policy.component.scss',
}) })
export class PrivacyPolicyComponent { export class PrivacyPolicyComponent {
/**
* Initializes the PrivacyPolicyComponent with Location.
*/
constructor(private location: Location) {} constructor(private location: Location) {}
/**
* Navigate back to the previous page.
*/
backClicked() { backClicked() {
this.location.back(); this.location.back();
} }