import {InputText} from 'primeng/primeng';
InputText is applied to an input field with pInputText directive.
<input type="text" pInputText />
A model can be bound using standard ngModel directive.
<input type="text" pInputText [(ngModel)]="property"/>
Name | Type | Default | Description |
---|---|---|---|
disabled | boolean | false | When present, it specifies that the element should be disabled. |
Following is the list of structural style classes, for theming classes visit theming page.
Name | Element |
---|---|
ui-inputtext | Input element |
Native directive that only requires the CSS of PrimeUI Inputtext.
<h3 class="first">Basic</h3>
<input id="in" type="text" size="30" pInputText [(ngModel)]="text" /> {{text}}
<h3>Disabled</h3>
<input id="in" type="text" size="30" pInputText [disabled]="disabled" />
<button type="button" (click)="toggleDisabled()" pButton label="Toggle"></button>
export class InputTextDemo {
text: string;
disabled: boolean = true;
toggleDisabled() {
this.disabled = !this.disabled;
}
}