Skip to content

Commit

Permalink
Merge pull request #26 from lucianojs/master
Browse files Browse the repository at this point in the history
correção da mascara em telefone #23.
  • Loading branch information
amarkes authored Sep 4, 2019
2 parents ac46b08 + 0dd76a9 commit d12b6d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/directives/br-mask.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Directive, HostListener, Input, SkipSelf, Host, Optional, ElementRef, Injectable, OnInit } from '@angular/core';
import { FormControl, FormGroupDirective, AbstractControl } from '@angular/forms';
import { Directive, ElementRef, Host, HostListener, Injectable, Input, OnInit, Optional, SkipSelf } from '@angular/core';
import { AbstractControl, FormControl, FormGroupDirective } from '@angular/forms';

export class BrMaskModel {
form: AbstractControl;
Expand Down Expand Up @@ -256,7 +256,7 @@ export class BrMaskDirective implements OnInit {
*/
private phoneMask(value: any): string {
let formValue = value;
if (formValue.length > 14) {
if (formValue.length > 14 || formValue.length === 11) {
this.brmasker.len = 15;
this.brmasker.mask = '(99) 99999-9999';
formValue = formValue.replace(/\D/gi, '');
Expand Down

0 comments on commit d12b6d7

Please sign in to comment.