Commit 8107f6ae by Matteo

sistemata pagina registrazione

parent a0c312e0
......@@ -52,7 +52,7 @@
<ion-input formControlName="email" type="email" placeholder="{{ 'email' | translate }}" ngModel required></ion-input>
</ion-item>
<ion-item>
<ion-input formControlName="cellulare" type="cellulare" placeholder="{{ 'cellulare' | translate }}" ngModel required></ion-input>
<ion-input formControlName="cellulare" type="tel" placeholder="{{ 'cellulare' | translate }}" ngModel required></ion-input>
</ion-item>
<ion-item>
<ion-input formControlName="password" type="password" placeholder="{{ 'pwd' | translate }}" ngModel required></ion-input>
......
......@@ -8,6 +8,7 @@ import { ErrorResponse } from '../../interface/error-response';
import { FormControl, Validators, FormGroup } from '@angular/forms';
import { environment } from 'src/environments/environment';
import { EventsService } from 'src/app/service/events.service';
import { PasswordValidator } from '../../validators/password.validator';
@Component({
selector: 'app-registrazione',
......@@ -72,7 +73,11 @@ export class RegistrazionePage implements OnInit {
])),
email: new FormControl('', Validators.compose([
Validators.required,
Validators.pattern('^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$')
//Validators.pattern('^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$')
Validators.email
])),
cellulare: new FormControl('', Validators.compose([
Validators.pattern('^[0-9]+$'),
])),
password: new FormControl('', Validators.compose([
Validators.minLength(5),
......@@ -82,29 +87,32 @@ export class RegistrazionePage implements OnInit {
passwordbis: new FormControl('', Validators.compose([
Validators.required
]))
},(formGroup: FormGroup) => {
return PasswordValidator.areEqual(formGroup);
});
validation_messages = {
'nome': [
{ type: 'required', message: 'Email � richiesta.' },
{ type: 'pattern', message: 'Deve essere composta da numeri e lettere' }
{ type: 'required', message: 'Nome e\' richiesto.' }
],
'cognome': [
{ type: 'required', message: 'Email � richiesta.' },
{ type: 'pattern', message: 'Deve essere composta da numeri e lettere' }
{ type: 'required', message: 'Cognome e\' richiesto.' }
],
'email': [
{ type: 'required', message: 'Email richiesta.' },
{ type: 'required', message: 'Email e\' richiesta.' },
{ type: 'pattern', message: 'Deve essere composta da numeri e lettere' }
],
'cellulare': [
{ type: 'pattern', message: 'Deve essere composto da numeri' }
],
'newpassword': [
{ type: 'required', message: 'Password richiesta.' },
{ type: 'minlength', message: 'La lunghezza minima 5 caratteri' },
{ type: 'required', message: 'Password e\' richiesta.' },
{ type: 'minlength', message: 'La lunghezza minima e\' 5 caratteri' },
{ type: 'pattern', message: 'Deve essere composta da numeri e lettere, minimo una maiuscola e una minuscola' }
],
'newpasswordbis': [
{ type: 'areEqual', message: 'La password deve essere uguale a quella nuova' },
{ type: 'required', message: 'Il Repeat Password richiesto.' }
{ type: 'required', message: 'Il Repeat Password e\' richiesto.' }
]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment