Skip to content

Commit

Permalink
feat(input): Criar suporte a propriedades [minLength] [maxLength] [re…
Browse files Browse the repository at this point in the history
…quired] [autocomplete].
  • Loading branch information
WilliamAguera committed May 26, 2017
1 parent 4e8e886 commit 21a262f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/input/input.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@

<input #input class="field"
attr.name="{{name}}"
attr.maxLength="{{maxLength}}"
attr.minLenght="{{minLength}}"
[(ngModel)]="value" type="text"
(keydown)="onKeyInput($event)"
(ngModelChange)="onInputChange($event)"
(blur)="onBlur()"
[ngClass]="{'-cursorblocked' : readonly || disabled, '-disabled': disabled, '-readonly': readonly}"
[readonly]="readonly ? true : null"
[disabled]="disabled ? true : null"
[autocomplete]="autocomplete"
[required]="required"
[ngModelOptions]="{standalone: true}"
[placeholder]="placeholder">

Expand Down
7 changes: 7 additions & 0 deletions src/input/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ export class TlInput extends ComponentHasModel implements AfterViewInit {
*/
@Input() disabled : boolean = null;

@Input() minLength: string;

@Input() maxLength: string;

@Input() required: number = null;

@Input() autocomplete: boolean;

/**
* The element itself to be manipulated
Expand Down

0 comments on commit 21a262f

Please sign in to comment.