Closed
Description
What is the expected behavior?
If I implement my component like this, it's behavior which I want
<md-input-container [formGroup]="formGroup">
<input mdInput [mdDatepicker]="datepicker" [formControlName]="control.name" [readOnly]="control.isReadonly"
[placeholder]="control.placeholder" [required]="control.isRequired">
<button *ngIf="!control.isReadonly" mdSuffix [mdDatepickerToggle]="datepicker"></button>
<md-error *ngIf="formGroup.controls[control.name].hasError('required')">Hello world</md-error>
</md-input-container>
<md-datepicker #datepicker></md-datepicker>
What is the current behavior?
Now I have array messages. And I have this implementation:
<md-input-container [formGroup]="formGroup">
<input mdInput [mdDatepicker]="datepicker" [formControlName]="control.name" [readOnly]="control.isReadonly"
[placeholder]="control.placeholder" [required]="control.isRequired">
<button *ngIf="!control.isReadonly" mdSuffix [mdDatepickerToggle]="datepicker"></button>
<ng-template ngFor let-errorMessage [ngForOf]="formGroup.controls[control.name].errorMessages">
<md-error *ngIf="formGroup.controls[control.name].hasError(errorMessage.type)">
{{ errorMessage.message }}
</md-error>
</ng-template>
</md-input-container>
<md-datepicker #datepicker></md-datepicker>
Maybe I use it incorrect. But i want to generate md-error automatically from array. I don't know what is this - new feature, bug or proposal. thanks
Metadata
Metadata
Assignees
Labels
No labels