Step by Step Creating Password Match Validator in Angular | Cross Controls Validations in Angular

preview_player
Показать описание
This video explains the steps to implement the Password-ConfirmPassword match validator in Angular.

Creating Reactive Form - 0.50 Min
Creating Confirm Password Validator - 5.20 Min
Applying Validator - 10.40 Min

Please Share the video and Subscribe to the channel.
Рекомендации по теме
Комментарии
Автор

bro just outstanding, jo muje apne iss task ka logic samjaya salute Thank You

YashdeepVadajiya
Автор

Thanks for this! Just a note to build on your effort here. If you want to pass parameters to your custom validator function you can do it like so:


export function checkvaluesmatch(val1: any, val2: any): ValidatorFn {
return (control: AbstractControl): ValidationErrors | null => {

let v1 = control.get(val1);
let v2 = control.get(val2);

if (v1 && v2 && v1?.value != v2?.value) {
return {
valuematcherror: true
}
}

return null;
}
}

This way you are not tied to using the key words 'password' and 'confirmpassword'. This is a more abstract approach. Then just call it like..
....{ validators: checkvaluesmatch('password', 'confirmpassword') });

codersexpo
Автор

That's great! Thank you so much for the tutorial. Short and beautiful!

JonMcKraken
Автор

Thank you very much! you've been incredibly helpful to me!

МарияБожко-ыв
Автор

Hi @dhanjay kumar, recently wateched your very nice, my one suggestion is, am a begginer to start angular, can you re- arrange the begginer level & intermediate level in your playlist, and also you created batch 4 in playlist it's okay with start that beginner level

muralim
Автор

thanks for the video but mat-error doesnt work with this validations

edwedw
join shbcf.ru