Class IgxInputDirective

The igxInput directive creates single- or multiline text elements, covering common scenarios when dealing with form inputs.

@igxmodule

IgxInputGroupModule

@igxparent

Data Entry & Display

@igxtheme

igx-input-group-theme

@igxkeywords

input, input group, form, field, validation

@igxgroup

presentation

@example
<input-group>
 <label for="address">Address</label>
 <input igxInput name="address" type="text" [(ngModel)]="customer.address">
</input-group>

Hierarchy

  • IgxInputDirective

Implements

  • AfterViewInit
  • OnDestroy

Constructors

constructor

  • new IgxInputDirective(inputGroup: IgxInputGroupBase, ngModel: NgModel, formControl: FormControlName, element: ElementRef<HTMLInputElement>, cdr: ChangeDetectorRef): IgxInputDirective

Properties

inputGroup

inputGroup: IgxInputGroupBase

isInput

isInput: boolean = false

Sets/gets whether the "igx-input-group__input" class is added to the host element. Default value is false.

@example
this.igxInput.isInput = true;
@example
let isCLassAdded = this.igxInput.isInput;

isTextArea

isTextArea: boolean = false

Sets/gets whether the "class.igx-input-group__textarea" class is added to the host element. Default value is false.

@example
this.igxInput.isTextArea = true;
@example
let isCLassAdded = this.igxInput.isTextArea;

Accessors

disabled

  • get disabled(): boolean
  • set disabled(value: boolean): void

focused

  • get focused(): boolean

hasPlaceholder

  • get hasPlaceholder(): boolean

isValid

  • get isValid(): boolean

nativeElement

  • get nativeElement(): HTMLInputElement

placeholder

  • get placeholder(): string

required

  • get required(): boolean
  • set required(value: boolean): void

valid

value

  • get value(): any
  • set value(value: any): void

Methods

focus

  • focus(): void