videoflix-frontend - v0.0.0
    Preparing search index...

    Signup component.

    Handles new user registration, including:

    • Reactive signup form with async email validation and password matching
    • Loading state and success feedback
    • Password visibility toggling
    • Automatic prefill of email if provided as input

    Selector: app-signup Standalone: true

    Implements

    • OnInit
    Index

    Constructors

    Properties

    allEmails: Signal<string[]> = ...

    Computed signal of all user emails fetched from AuthService. Used to dynamically validate new user emails for uniqueness.

    destroyRef: DestroyRef = ...

    Angular DestroyRef used to manage subscription cleanup.

    email: InputSignal<string> = ...

    Optional email input, typically used when navigating from other flows (e.g. forgot password).

    isSingupLoading: WritableSignal<boolean> = ...

    Signal controlling loading spinner during signup submission.

    showConfirmPassword: WritableSignal<boolean> = ...

    Signal controlling confirm-password input visibility.

    showPassword: WritableSignal<boolean> = ...

    Signal controlling password input visibility.

    signupForm: FormGroup<
        {
            email: FormControl<string | null>;
            passwords: FormGroup<
                {
                    confirmPassword: FormControl<string | null>;
                    password: FormControl<string | null>;
                },
            >;
        },
    > = ...

    Reactive signup form definition.

    Structure:

    • email: required, valid email format, async uniqueness check.
    • passwords: nested group containing:
      • password: required, min length 6.
      • confirmPassword: required, must match password.
    successFullSignup: WritableSignal<boolean> = ...

    Signal indicating that the signup process completed successfully.

    userData: WritableSignal<{ email: string; username: string }> = ...

    Stores basic user data for display after successful registration.

    Methods

    • Lifecycle hook.

      Pre-fills the email field if an input value is provided (e.g. redirected from another page).

      Returns void

    • Handles signup form submission.

      Behavior:

      • Validates the form before sending data.
      • Activates loading spinner while request is in progress.
      • Sends signup data (email, password, confirmPassword) via AuthService.
      • On success, stores user info and toggles success signal.
      • On error, resets the form and clears loading state.
      • Automatically unsubscribes on destroy.

      Returns void

    • Toggles visibility of password or confirm password input fields.

      Parameters

      • field: string

        Either 'password' or 'confirmPassword'.

      Returns void

      this.togglePasswordVisibility('password');