I'm using the md-input component of material for Angular 2. I know it's still a alpha version of material but maybe someone could explain me how to use the html validation attribute required of Angular 2 with md-input(Is it implemented yet?). I have tried this(works fine):
<md-card>
<md-input
placeholder="Url"
id="url"
url="url"
[(ngModel)]="urlInputValue"
#url="ngModel"
required>
<md-hint *ngIf="url.errors && (url.dirty || url.touched)" [ngStyle]="{'color': 'red'}"> Url is required </md-hint>
</md-input>
<button
md-raised-button color="accent"
[disabled]="isUrlInputEmpty()"
(click)="onRequestBtnClick()">
Request
</button>
</md-card>
How I can use 'required'?
<md-hint *ngIf="url.errors.required && (url.dirty || url.touched)" [ngStyle]="{'color': 'red'}"> Url is required </md-hint>
urlin the TS part ? and normally if it is mentionedrequiredin themd-inputelement it should be required.FromGroupmodule ?