'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;
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
add a comment |
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
First you should declare employeesComponent in declarations of your module.
– Thivanka Saranatha
Mar 24 at 6:17
add a comment |
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
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
html angular angular-material
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
First you should declare employeesComponent in declarations of your module.
– Thivanka Saranatha
Mar 24 at 6:17