ולידציה לאימות סיסמא -- דחוף!!

שלוות נפש

משתמש פעיל
היי
אני מנסה לעשות ולידציה לאימות סיסמא עם mat-step של angular material.
בSTEP הראשון של הסיסמא יש אפשרות ללחוץ הבא אבל ב STEP השני לא נותן --משהו כנראה בפונקציית הוילדציה לא נכון..
מצרפת קודים אשמח לעזרה - תודה!!

זה ה HTML:
HTML:
<mat-step [stepControl]="thirdFormGroup" errorMessage="ערך סיסמא חסר/ לא תקין">
      <form [formGroup]="thirdFormGroup">
        <ng-template matStepLabel>סיסמא</ng-template>
        <mat-form-field appearance="fill">
          <mat-label>הכנס סיסמא</mat-label>
          <input matInput [type]="hide ? 'password' : 'text'" formControlName="thirdCtrl">
          <button mat-icon-button matSuffix (click)="hide = !hide" [attr.aria-label]="'Hide password'" [attr.aria-pressed]="hide">
            <mat-icon>{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>
          </button>
        </mat-form-field>
      
        <div>
          <button mat-button matStepperPrevious>הקודם</button>
          <button mat-button matStepperNext (click) = "clickPassword1()">הבא</button>
        </div>
      </form>
    </mat-step>


    <mat-step [stepControl]="fourFormGroup" errorMessage="ערך סיסמא לא תואם">
      <form [formGroup]="fourFormGroup">
        <ng-template matStepLabel>חזור על הסיסמא</ng-template>
        <mat-form-field appearance="fill">
          <mat-label>הכנס סיסמא</mat-label>
          <input matInput [type]= "hide ? 'password' : 'text'" formControlName="fourCtrl">
          <button mat-icon-button matSuffix (click)="hide = !hide" [attr.aria-label]="'Hide password'" [attr.aria-pressed]="hide">
            <mat-icon>{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>
          </button>
        </mat-form-field>
וזה ה JS:
JavaScript:
ngOnInit(): void {
    this.firstFormGroup = new FormGroup({'firstCtrl': new FormControl('', [Validators.required])
    });
    this.secondFormGroup =new FormGroup({'secondCtrl': new FormControl('', [Validators.required, Validators.pattern('[0-9]{9,9}')])
    });
    this.thirdFormGroup = new FormGroup({'thirdCtrl': new FormControl('',[Validators.required, Validators.pattern('[0-9]{6,10}')])
    });
    this.fourFormGroup = new FormGroup({'fourCtrl': new FormControl('', [Validators.required, Validators.pattern('[0-9]{6,10}'), this.passwordValidators.bind(this)])
    });
  }
  //Validators on the passwords.
  passwordValidators(password : FormControl): { [errorPassword: string]: boolean } {
    console.log("password",password)
    if (password.value != this.password1){
      // console.log("לא תואם")
      return { errorPassword: true }
    
    }
    // console.log("תואם")
    return { errorPassword: false };
  }
 

אולי מעניין אותך גם...

הפרק היומי

הפרק היומי! כל ערב פרק תהילים חדש. הצטרפו אלינו לקריאת תהילים משותפת!


תהילים פרק קל

א שִׁיר הַמַּעֲלוֹת מִמַּעֲמַקִּים קְרָאתִיךָ יְהוָה:ב אֲדֹנָי שִׁמְעָה בְקוֹלִי תִּהְיֶינָה אָזְנֶיךָ קַשֻּׁבוֹת לְקוֹל תַּחֲנוּנָי:ג אִם עֲוֹנוֹת תִּשְׁמָר יָהּ אֲדֹנָי מִי יַעֲמֹד:ד כִּי עִמְּךָ הַסְּלִיחָה לְמַעַן תִּוָּרֵא:ה קִוִּיתִי יְהוָה קִוְּתָה נַפְשִׁי וְלִדְבָרוֹ הוֹחָלְתִּי:ו נַפְשִׁי לַאדֹנָי מִשֹּׁמְרִים לַבֹּקֶר שֹׁמְרִים לַבֹּקֶר:ז יַחֵל יִשְׂרָאֵל אֶל יְהוָה כִּי עִם יְהוָה הַחֶסֶד וְהַרְבֵּה עִמּוֹ פְדוּת:ח וְהוּא יִפְדֶּה אֶת יִשְׂרָאֵל מִכֹּל עֲוֹנֹתָיו:
נקרא  19  פעמים

אתגר AI

ממה זה עשוי...? • אתגר 16

לוח מודעות

למעלה