core/forms/form-group.component.ts
A form group helps to validate an input of a form element.
* <c8y-form-group [hasWarning]="user.email.length === 0">
* <label translate for="userEmail">Email</label>
* <input
* id="userEmail"
* class="form-control"
* type="email"
* name="email"
* [maxlength]="254"
* autocomplete="off"
* placeholder="{{'e.g. joe.doe@example.com' | translate}}"
* [(ngModel)]="user.email"
* email
* required
* >
* <c8y-messages>
* <c8y-message *ngIf="user.email.length === 0" translate></c8y-message>
* <c8y-message name="required" text="The E-Mail is SUPER required"></c8y-message>
* </c8y-messages>
* </c8y-form-group>
*
host | { |
selector | c8y-form-group |
templateUrl | ./form-group.component.html |
Properties |
Methods |
Inputs |
HostBindings |
hasError
|
Default value : |
hasSuccess
|
Default value : |
hasWarning
|
Default value : |
novalidation
|
Default value : |
status
|
Type : |
class.has-error |
class.has-error:
|
class.has-success |
class.has-success:
|
class.has-warning |
class.has-warning:
|
initNgModel |
initNgModel()
|
Returns :
void
|
ngAfterContentInit |
ngAfterContentInit()
|
Returns :
void
|
ngOnDestroy |
ngOnDestroy()
|
Returns :
void
|
update |
update()
|
Returns :
void
|
customErrorMessage |
customErrorMessage:
|
Type : MessagesComponent
|
Decorators :
@ContentChild(MessagesComponent, {static: undefined})
|
errors |
errors:
|
Type : literal type
|
model |
model:
|
Type : NgModel
|
Decorators :
@ContentChild(NgModel, {static: undefined})
|
<ng-content></ng-content>
<c8y-messages *ngIf="!customErrorMessage" [show]="errors"></c8y-messages>