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 { RouterOutlet } from '@angular/router';
import { ErrorToastComponent } from './shared/components/error-toast/error-toast.component';
@Component({
selector: 'app-root',
@ -10,5 +9,5 @@ import { ErrorToastComponent } from './shared/components/error-toast/error-toast
styleUrl: './app.component.scss',
})
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',
})
export class ForgotPasswordComponent implements OnInit {
sendMailSuccess: boolean = false;
queryEmail: boolean = false;
queryEmailSuccess: boolean = false;
authData = {
mail: '',
token: '',
@ -22,12 +26,8 @@ export class ForgotPasswordComponent implements OnInit {
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(
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(
private route: ActivatedRoute,

View file

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

View file

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

View file

@ -51,7 +51,8 @@ export class HeroBannerComponent implements OnChanges {
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(
private videoService: VideoService,

View file

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

View file

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

View file

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

View file

@ -8,7 +8,10 @@ import { AuthService } from '../services/auth.service';
providedIn: 'root',
})
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.

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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