Migrating from tg-input-container (tg-light)
Replace the tg-input-containertg2-input-container[theme]="'tg-light'"tg-input-containertgTextInputtg2InputTg2InputContainerComponentTg2InputDirectiveTgInputContainerComponentTgInputDirective
tg2 fields don't integrate with tg-form-grouptg-validation-summary
Selector
Before
After
<!-- Before -->
<tg-input-container label="Title">
<input tgTextInput [(ngModel)]="title" />
</tg-input-container>
<!-- After -->
<tg2-input-container label="Title" [theme]="'tg-light'">
<input tg2Input [(ngModel)]="title" />
</tg2-input-container>Form bindings
ngModelformControlNameformField
<!-- Before -->
<tg-input-container label="Email">
<input tgTextInput type="email" formControlName="email" />
</tg-input-container>
<!-- After — bindings are unchanged -->
<tg2-input-container label="Email" [theme]="'tg-light'">
<input tg2Input type="email" formControlName="email" />
</tg2-input-container>Icons
The projected <tg-icon-left><tg-icon-right>iconLefticonRight
Before
After
<!-- Before -->
<tg-input-container label="Search">
<tg-icon-left name="search" role="presentation"></tg-icon-left>
<input tgTextInput [(ngModel)]="query" />
</tg-input-container>
<!-- After -->
<tg2-input-container label="Search" iconLeft="search" [theme]="'tg-light'">
<input tg2Input [(ngModel)]="query" />
</tg2-input-container>Optional
Nothing to change. Like tg-input-containertg2-input-containerrequiredValidators.requiredtg2-input-containershowOptional="false"
Before
After
<!-- Before -->
<tg-input-container label="Title">
<input tgTextInput [(ngModel)]="title" />
</tg-input-container>
<!-- After: unchanged, "(optional)" still comes from whether the field is required -->
<tg2-input-container label="Title" [theme]="'tg-light'">
<input tg2Input [(ngModel)]="title" />
</tg2-input-container>
<!-- New in tg2-input-container: hide "(optional)" on a field that isn't a form question -->
<tg2-input-container label="Search" iconLeft="search" showOptional="false" [theme]="'tg-light'">
<input tg2Input type="search" [(ngModel)]="query" />
</tg2-input-container>Validation messages
tg-input-containertg-validation-messagestg2-input-containererrorMessage
<!-- Before (tg-validation-messages read the control's validators) -->
<tg-input-container label="Title">
<input tgTextInput required [(ngModel)]="title" />
</tg-input-container>
<!-- After (an explicit errorMessage input) -->
<tg2-input-container label="Title" errorMessage="Title is required" [theme]="'tg-light'">
<input tg2Input required [(ngModel)]="title" />
</tg2-input-container>Characters remaining
tg-input-containertg2-input-containershowRemainingCharactersmaxlength
Not supported
These inputs have no tg2-input-container
inlinecancelablesizeshowAllValidationshowValidation
<!-- Not supported in tg2-input-container -->
<tg-input-container
label="Title"
[inline]="true"
[cancelable]="true"
[size]="InputSizeEnum.large"
[showAllValidation]="true"
[showValidation]="false">
<input tgTextInput [(ngModel)]="title" />
</tg-input-container>