javascript - md-form-field is not a known element Angular Material -
error
uncaught error: template parse errors: 'md-form-field' not known element: 1. if 'md-form-field' angular component, verify part of module. 2. if 'md-form-field' web component add 'custom_elements_schema' '@ngmodule.schemas' of component suppress message. ("
i have implemented angular input angular material
url https://material.angular.io/components/input/overview
html
<form class="example-form"> <md-form-field class="example-full-width"> <input mdinput placeholder="favorite food" value="sushi"> </md-form-field> </form>
after googling found link
which says
import { mdformfieldmodule } '@angular/material'; @ngmodule({ imports: [ .... mdformfieldmodule, .... ]
app.module.ts after importing
import { mdformfieldmodule } '@angular/material';
error in d:/frontend/src/app/app.module.ts (97,10): module '"d:/frontendapp/node_modules/@angular/material/material"' has no exported member 'mdformfieldmodule'.
- can suggest im missing.
add schemas: [custom_elements_schema]
, import {mdinputmodule} '@angular/material'
instead of mdformfieldmodule it's outdated.
@ngmodule({ declarations: [ .. ], imports: [ mdinputmodule, .. ], schemas: [custom_elements_schema] })
to module
Comments
Post a Comment