md-input-container NOT working as expected

1.9k Views Asked by At

I have the simple markup using "@angular/material": "^2.0.0-beta.1"

import {
  MaterialModule, MdIconRegistry, OVERLAY_PROVIDERS, MdInputContainer,
  MdInputDirective
} from '@angular/material'

....

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

When I try to run the code I am getting

EXCEPTION: Error in ./RaceComponent class RaceComponent - inline template:19:4 caused by: md-input-container must contain an md-input directive. Did you forget to add md-input to the native input or textarea element?

MdInput is directive is marked as deprecated.

What am I doing wrong?

1

There are 1 best solutions below

1
On BEST ANSWER

try

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

instead of

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

i had the same issue yesterday. Something has changed, but the documentation has not updated yet.