Skip to content

Commit

Permalink
Merge pull request #206 from wantero/master
Browse files Browse the repository at this point in the history
Telefone obrigatorio
  • Loading branch information
raffacabofrio authored Mar 21, 2019
2 parents 7efb64f + 581eba3 commit 90847f0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/app/components/account/account.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ <h1 class="text-center display-4">Editar Perfil</h1>
</div>

<div *ngIf="formGroup.controls['phone'].touched && !formGroup.controls['phone'].valid">
<small class="form-text text-danger" *ngIf="formGroup.controls['phone'].hasError('required')">
Telefone obrigatório.
</small>
<small class="form-text text-danger" *ngIf="formGroup.controls['phone'].hasError('pattern')">
Telefone deve estar no formato (99) 99999-9999
</small>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/account/account.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class AccountComponent implements OnInit {
this.formGroup = _formBuilder.group({
name: ['', [Validators.required, Validators.minLength(3), Validators.maxLength(200)]],
email: ['', [Validators.required, Validators.pattern(AppConst.emailPattern)]],
phone: ['', [Validators.pattern(AppConst.phonePattern)]],
phone: ['', [Validators.required, Validators.pattern(AppConst.phonePattern)]],
linkedin: ['', [Validators.pattern(AppConst.linkedInUrlPattern)]],
Address: _formBuilder.group({
postalCode: ['', [Validators.required, Validators.pattern(AppConst.postalCodePattern)]],
Expand Down
3 changes: 3 additions & 0 deletions src/app/components/register/register.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ <h1 class="text-center display-4">Registro</h1>
</div>

<div *ngIf="formGroup.controls['phone'].touched && !formGroup.controls['phone'].valid">
<small class="form-text text-danger" *ngIf="formGroup.controls['phone'].hasError('required')">
Telefone obrigatório.
</small>
<small class="form-text text-danger" *ngIf="formGroup.controls['phone'].hasError('pattern')">
Telefone deve estar no formato (99) 99999-9999
</small>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/register/register.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class RegisterComponent implements OnInit {
email: ['', [Validators.required, Validators.pattern(AppConst.emailPattern)]],
password: ['', [Validators.required, Validators.pattern(AppConst.passwordPattern)]],
confirmPassword: ['', [Validators.required]],
phone: ['', [Validators.pattern(AppConst.phonePattern)]],
phone: ['', [Validators.required, Validators.pattern(AppConst.phonePattern)]],
linkedin: ['', [Validators.pattern(AppConst.linkedInUrlPattern)]],
postalCode: ['', [Validators.required, Validators.pattern(AppConst.postalCodePattern)]],
street: ['', [Validators.required]],
Expand Down

0 comments on commit 90847f0

Please sign in to comment.