'mat-card' is not a known element in Angular 7How to move an element into another element?Angular 2 Routing Does Not Work When Deployed to Http ServerAngular 2 'component' is not a known elementCan't use Ionic 3 + Material AngularError: Template parse errors: 'mat-card' is not a known element:Angular4 multiple modules issue'mat-toolbar' is not a known element - Angular 5ng: 'mat-table' is not a known elementCore module component and Shared module implementation in angularAngular mat-divider is not a known element

Using credit/debit card details vs swiping a card in a payment (credit card) terminal

How do Human Traits Work?

At what point in European history could a government build a printing press given a basic description?

Boss wants me to falsify a report. How should I document this unethical demand?

When and what was the first 3D acceleration device ever released?

Plot twist where the antagonist wins

Passively reducing ground loss?

What is quasi-aromaticity?

Compactness of finite sets

Find limit in use of integrals

If a person had control of every single cell of their body, would they be able to transform into another creature?

What are these arcade games in Ghostbusters 1984?

Is it possible to play as a necromancer skeleton?

Binary Search in C++17

How to respond to an upset student?

Employer demanding to see degree after poor code review

A steel cutting sword?

Why aren't space telescopes put in GEO?

Popcorn is the only acceptable snack to consume while watching a movie

Pirate democracy at its finest

How to know if a folder is a symbolic link?

What is the object moving across the ceiling in this stock footage?

Why does a perfectly-identical repetition of a drawing command given within an earlier loop 𝘯𝘰𝘵 produce exactly the same line?

What was the idiom for something that we take without a doubt?



'mat-card' is not a known element in Angular 7


How to move an element into another element?Angular 2 Routing Does Not Work When Deployed to Http ServerAngular 2 'component' is not a known elementCan't use Ionic 3 + Material AngularError: Template parse errors: 'mat-card' is not a known element:Angular4 multiple modules issue'mat-toolbar' is not a known element - Angular 5ng: 'mat-table' is not a known elementCore module component and Shared module implementation in angularAngular mat-divider is not a known element






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








2















I've seen a lot of questions on this but doesn't seem to be the same issue Im encountering. I have just created my 2nd angular project. I have a new component under src/app/employees where I am trying to use in employees.component.html . The error I am getting is:



Uncaught Error: Template parse errors:
'mat-card' is not a known element:
1. If 'mat-card' is an Angular component, then verify that it is part of this module.
2. If 'mat-card' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("[ERROR ->]<mat-card> </mat-card>


Now, in app.module.ts I have:



import BrowserModule from "@angular/platform-browser";
import BrowserAnimationsModule from "@angular/platform-browser/animations";
import LOCALE_ID, NgModule from "@angular/core";
import HttpClientModule, HTTP_INTERCEPTORS from "@angular/common/http";
import AppRoutingModule from "./app-routing.module";
import AppComponent from "./app.component";
import
MatButtonModule,
MatFormFieldModule,
MatIconModule,
MatInputModule,
MatListModule,
MatSelectModule,
MatSidenavModule,
MatCardModule,
MatTableModule
from "@angular/material";

@NgModule(
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
HttpClientModule,
MatButtonModule,
MatFormFieldModule,
MatIconModule,
MatListModule,
MatInputModule,
MatSelectModule,
MatSidenavModule,
MatCardModule,
MatTableModule
],....
)
export class AppModule


And there aren't any errors if I use mat-card in app.component.html.
What am I missing here?










share|improve this question






















  • First you should declare employeesComponent in declarations of your module.

    – Thivanka Saranatha
    Mar 24 at 6:17

















2















I've seen a lot of questions on this but doesn't seem to be the same issue Im encountering. I have just created my 2nd angular project. I have a new component under src/app/employees where I am trying to use in employees.component.html . The error I am getting is:



Uncaught Error: Template parse errors:
'mat-card' is not a known element:
1. If 'mat-card' is an Angular component, then verify that it is part of this module.
2. If 'mat-card' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("[ERROR ->]<mat-card> </mat-card>


Now, in app.module.ts I have:



import BrowserModule from "@angular/platform-browser";
import BrowserAnimationsModule from "@angular/platform-browser/animations";
import LOCALE_ID, NgModule from "@angular/core";
import HttpClientModule, HTTP_INTERCEPTORS from "@angular/common/http";
import AppRoutingModule from "./app-routing.module";
import AppComponent from "./app.component";
import
MatButtonModule,
MatFormFieldModule,
MatIconModule,
MatInputModule,
MatListModule,
MatSelectModule,
MatSidenavModule,
MatCardModule,
MatTableModule
from "@angular/material";

@NgModule(
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
HttpClientModule,
MatButtonModule,
MatFormFieldModule,
MatIconModule,
MatListModule,
MatInputModule,
MatSelectModule,
MatSidenavModule,
MatCardModule,
MatTableModule
],....
)
export class AppModule


And there aren't any errors if I use mat-card in app.component.html.
What am I missing here?










share|improve this question






















  • First you should declare employeesComponent in declarations of your module.

    – Thivanka Saranatha
    Mar 24 at 6:17













2












2








2








I've seen a lot of questions on this but doesn't seem to be the same issue Im encountering. I have just created my 2nd angular project. I have a new component under src/app/employees where I am trying to use in employees.component.html . The error I am getting is:



Uncaught Error: Template parse errors:
'mat-card' is not a known element:
1. If 'mat-card' is an Angular component, then verify that it is part of this module.
2. If 'mat-card' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("[ERROR ->]<mat-card> </mat-card>


Now, in app.module.ts I have:



import BrowserModule from "@angular/platform-browser";
import BrowserAnimationsModule from "@angular/platform-browser/animations";
import LOCALE_ID, NgModule from "@angular/core";
import HttpClientModule, HTTP_INTERCEPTORS from "@angular/common/http";
import AppRoutingModule from "./app-routing.module";
import AppComponent from "./app.component";
import
MatButtonModule,
MatFormFieldModule,
MatIconModule,
MatInputModule,
MatListModule,
MatSelectModule,
MatSidenavModule,
MatCardModule,
MatTableModule
from "@angular/material";

@NgModule(
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
HttpClientModule,
MatButtonModule,
MatFormFieldModule,
MatIconModule,
MatListModule,
MatInputModule,
MatSelectModule,
MatSidenavModule,
MatCardModule,
MatTableModule
],....
)
export class AppModule


And there aren't any errors if I use mat-card in app.component.html.
What am I missing here?










share|improve this question














I've seen a lot of questions on this but doesn't seem to be the same issue Im encountering. I have just created my 2nd angular project. I have a new component under src/app/employees where I am trying to use in employees.component.html . The error I am getting is:



Uncaught Error: Template parse errors:
'mat-card' is not a known element:
1. If 'mat-card' is an Angular component, then verify that it is part of this module.
2. If 'mat-card' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("[ERROR ->]<mat-card> </mat-card>


Now, in app.module.ts I have:



import BrowserModule from "@angular/platform-browser";
import BrowserAnimationsModule from "@angular/platform-browser/animations";
import LOCALE_ID, NgModule from "@angular/core";
import HttpClientModule, HTTP_INTERCEPTORS from "@angular/common/http";
import AppRoutingModule from "./app-routing.module";
import AppComponent from "./app.component";
import
MatButtonModule,
MatFormFieldModule,
MatIconModule,
MatInputModule,
MatListModule,
MatSelectModule,
MatSidenavModule,
MatCardModule,
MatTableModule
from "@angular/material";

@NgModule(
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
HttpClientModule,
MatButtonModule,
MatFormFieldModule,
MatIconModule,
MatListModule,
MatInputModule,
MatSelectModule,
MatSidenavModule,
MatCardModule,
MatTableModule
],....
)
export class AppModule


And there aren't any errors if I use mat-card in app.component.html.
What am I missing here?







html angular angular-material






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 24 at 5:39









WoodyWoody

39711019




39711019












  • First you should declare employeesComponent in declarations of your module.

    – Thivanka Saranatha
    Mar 24 at 6:17

















  • First you should declare employeesComponent in declarations of your module.

    – Thivanka Saranatha
    Mar 24 at 6:17
















First you should declare employeesComponent in declarations of your module.

– Thivanka Saranatha
Mar 24 at 6:17





First you should declare employeesComponent in declarations of your module.

– Thivanka Saranatha
Mar 24 at 6:17












1 Answer
1






active

oldest

votes


















4














I can not see your EmployeesComponent in your list of declarations. The EmployeesComponent need to be declared in the same module as where you import the MatCardModule, like:



declarations: [
EmployeesComponent
],
imports: [
MatCardModule
]


I am guessing either that you have forgotten to declare the EmployeesComponent in your app module, or that you have another module, perhaps Employees module, where you have to import the MatCardModule.






share|improve this answer























  • Thanks. I had EmployeesComponent in app-routing.module.ts. I've made some changes and all is working as expected now.

    – Woody
    Mar 24 at 6:34











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55321041%2fmat-card-is-not-a-known-element-in-angular-7%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














I can not see your EmployeesComponent in your list of declarations. The EmployeesComponent need to be declared in the same module as where you import the MatCardModule, like:



declarations: [
EmployeesComponent
],
imports: [
MatCardModule
]


I am guessing either that you have forgotten to declare the EmployeesComponent in your app module, or that you have another module, perhaps Employees module, where you have to import the MatCardModule.






share|improve this answer























  • Thanks. I had EmployeesComponent in app-routing.module.ts. I've made some changes and all is working as expected now.

    – Woody
    Mar 24 at 6:34















4














I can not see your EmployeesComponent in your list of declarations. The EmployeesComponent need to be declared in the same module as where you import the MatCardModule, like:



declarations: [
EmployeesComponent
],
imports: [
MatCardModule
]


I am guessing either that you have forgotten to declare the EmployeesComponent in your app module, or that you have another module, perhaps Employees module, where you have to import the MatCardModule.






share|improve this answer























  • Thanks. I had EmployeesComponent in app-routing.module.ts. I've made some changes and all is working as expected now.

    – Woody
    Mar 24 at 6:34













4












4








4







I can not see your EmployeesComponent in your list of declarations. The EmployeesComponent need to be declared in the same module as where you import the MatCardModule, like:



declarations: [
EmployeesComponent
],
imports: [
MatCardModule
]


I am guessing either that you have forgotten to declare the EmployeesComponent in your app module, or that you have another module, perhaps Employees module, where you have to import the MatCardModule.






share|improve this answer













I can not see your EmployeesComponent in your list of declarations. The EmployeesComponent need to be declared in the same module as where you import the MatCardModule, like:



declarations: [
EmployeesComponent
],
imports: [
MatCardModule
]


I am guessing either that you have forgotten to declare the EmployeesComponent in your app module, or that you have another module, perhaps Employees module, where you have to import the MatCardModule.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 24 at 5:51









SnorreDanSnorreDan

802613




802613












  • Thanks. I had EmployeesComponent in app-routing.module.ts. I've made some changes and all is working as expected now.

    – Woody
    Mar 24 at 6:34

















  • Thanks. I had EmployeesComponent in app-routing.module.ts. I've made some changes and all is working as expected now.

    – Woody
    Mar 24 at 6:34
















Thanks. I had EmployeesComponent in app-routing.module.ts. I've made some changes and all is working as expected now.

– Woody
Mar 24 at 6:34





Thanks. I had EmployeesComponent in app-routing.module.ts. I've made some changes and all is working as expected now.

– Woody
Mar 24 at 6:34



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid …


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55321041%2fmat-card-is-not-a-known-element-in-angular-7%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?