What I'm Using
What I'm doing
I just started a new project and installed material
When copying some syntax from a previous project, I get an error when trying to import
'import { MdInputModule} from '@angular/material';
'md-form-field' is not a known element:
HTML
<form [formGroup]="albumEdit">
<md-form-field>
<input mdInput formControlName="albumTitle" placeholder="Album Title">
</md-form-field>
</form>
Questions
Since 2.0.0-beta.12
, Md
prefix has been removed in favor of Mat
prefix. See this CHANGELOG:
Breaking Changes All "md" prefixes have been removed.Change
md
prefix tomat
:
In your typescript,
import { MatInputModule} from '@angular/material';
and in you template:
<mat-form-field>
<input matInput formControlName="albumTitle" placeholder="Album Title">
</mat-form-field>
The documentation on the website is outdated and needs to be update with mat
prefix.
For angular 8+
import {MatInputModule} from '@angular/material/input';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With