Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

password validation in angular

This question could be solved with a combination of these two answers: https://stackoverflow.com/a/43493648/6294072 and https://stackoverflow.com/a/47670892/6294072

So first of all, you would need a custom validator for checking the passwords, that could look like this:

checkPasswords(group: FormGroup) { // here we have the 'passwords' group
  const password = group.get('password').value;
  const confirmPassword = group.get('confirmPassword').value;

  return password === confirmPassword ? null : { notSame: true }     
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript closure function example 
Javascript :: string methods javascript 
Javascript :: mongoosejs 
Javascript :: search box in material angular 
Javascript :: puppeteer 
Javascript :: javascript set color in hex 
Javascript :: javascript swap images on mouseover 
Javascript :: connect node server with knex database 
Javascript :: import and export type in js 
Javascript :: redux saga fetch api 
Javascript :: jwt 
Javascript :: javascript data 
Javascript :: using python with javascript 
Javascript :: javascript debugging exercises 
Javascript :: invariant failed you should not use link outside a router test 
Javascript :: angular countdown begin stop pause 
Javascript :: compare strings js 
Javascript :: jquery moment js 
Javascript :: if else jsx 
Javascript :: flatlist only rendering 10 items 
Javascript :: nestjs swagger 
Javascript :: linear equations calculator 
Javascript :: react why onclick property function trigger without click 
Javascript :: is promise 
Javascript :: check if browser supports Local Storage 
Javascript :: reverse array elements in javascript 
Javascript :: json to pdf javascript 
Javascript :: connect mongodb using mongoose in node js 
Javascript :: javascript single thread 
Javascript :: react scrip for deplot heroku 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =