Input number in Angular Material Design?

Viewed 80889

There is the standard input as:

 <input type="number" placeholder="Hours">

Is there something in Angular Material Design?

enter image description here

I use Angular latest version

I tried this, but it is just simple input:

<md-input-container>
  <input mdInput type="number" placeholder="Favorite food" value="Sushi">
</md-input-container>

It should be < md-input-container input="number">? ot input type="number"> ?

3 Answers

Use this for angular material number,

<mat-form-field>
  <input
    type="number"
    class="form-control"
    matInput
    name="value"
    placeholder="Slab"
    (change)="xxx()"
    formControlName="value">
</mat-form-field>

This one is not working anymore

<md-input-container></md-input-container>

This works fine..

<mat-label>Time</mat-label>
    <input type="number" class="form-control" matInput name="time" placeholder="Time" change)="xxx($event)" formControlName="time" required>

In .TS file, you can have the change event with xxx (e) { console.log(e); }

Related