val2
This commit is contained in:
31
src/app/validators/username.validator.ts
Normal file
31
src/app/validators/username.validator.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
import { AbstractControl } from '@angular/forms';
|
||||
import { RegistrationService } from '../registration.service';
|
||||
|
||||
|
||||
export class ValidateUserName{
|
||||
|
||||
constructor(
|
||||
private RS: RegistrationService
|
||||
){ }
|
||||
|
||||
validateUserName( control: AbstractControl ){
|
||||
//var RS = new RegistrationService(null);
|
||||
/*
|
||||
this.registrationService2.validateUserName( control.value ).subscribe( data => {
|
||||
console.log( data );
|
||||
if( control.value != data.username ){
|
||||
return{
|
||||
validUserName: true
|
||||
};
|
||||
}
|
||||
return null;
|
||||
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user