question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

md-content is not a known element

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

The md-content component should work

What is the current behavior?

It is not recognized `zone.js:484Unhandled Promise rejection: Template parse errors: ‘md-content’ is not a known element:

  1. If ‘md-content’ is an Angular component, then verify that it is part of this module.
  2. If ‘md-content’ is a Web Component then add “CUSTOM_ELEMENTS_SCHEMA” to the ‘@NgModule.schema’ of this component to suppress this message. ("[ERROR ->]<md-content> <md-toolbar color="primary"> <span>{{ title }}</span> "): AppComponent@0:0 ; Zone: <root> ; Task: Promise.then ; Value: Error: Template parse errors:(…) Error: Template parse errors: ‘md-content’ is not a known element:
  3. If ‘md-content’ is an Angular component, then verify that it is part of this module.
  4. If ‘md-content’ is a Web Component then add “CUSTOM_ELEMENTS_SCHEMA” to the ‘@NgModule.schema’ of this component to suppress this message. ("[ERROR ->]<md-content> <md-toolbar color="primary"> <span>{{ title }}</span> "): AppComponent@0:0 at TemplateParser.parse (http://angular-back.lbo.local:4200/main.bundle.js:43075:21) at RuntimeCompiler._compileTemplate (http://angular-back.lbo.local:4200/main.bundle.js:51429:53) at http://angular-back.lbo.local:4200/main.bundle.js:51352:85 at Set.forEach (native) at compile (http://angular-back.lbo.local:4200/main.bundle.js:51352:49) at ZoneDelegate.invoke (http://angular-back.lbo.local:4200/main.bundle.js:68979:29) at Zone.run (http://angular-back.lbo.local:4200/main.bundle.js:68872:44) at http://angular-back.lbo.local:4200/main.bundle.js:69238:58 at ZoneDelegate.invokeTask (http://angular-back.lbo.local:4200/main.bundle.js:69012:38) at Zone.runTask (http://angular-back.lbo.local:4200/main.bundle.js:68912:48)consoleError @ zone.js:484_loop_1 @ zone.js:511drainMicroTaskQueue @ zone.js:515 zone.js:486Error: Uncaught (in promise): Error: Template parse errors:(…)consoleError @ zone.js:486_loop_1 @ zone.js:511drainMicroTaskQueue @ zone.js:515`

What are the steps to reproduce?

Use last angular-cli@webpack (master branch) with

What is the use-case or motivation for changing an existing behavior?

Not applicable

Which versions of Angular, Material, OS, browsers are affected?

Angular 2.0.0-rc.6; angular-cli@webpack (master), Material 2.0.0-alpha.8-1

Is there anything else we should know?

In package.json "@angular2-material/core": "^2.0.0-alpha.8-1", "@angular2-material/button": "^2.0.0-alpha.8-1", "@angular2-material/button-toggle": "^2.0.0-alpha.8-1", "@angular2-material/card": "^2.0.0-alpha.8-1", "@angular2-material/checkbox": "^2.0.0-alpha.8-1", "@angular2-material/grid-list": "^2.0.0-alpha.8-1", "@angular2-material/icon": "^2.0.0-alpha.8-1", "@angular2-material/input": "^2.0.0-alpha.8-1", "@angular2-material/list": "^2.0.0-alpha.8-1", "@angular2-material/menu": "^2.0.0-alpha.8-1", "@angular2-material/progress-bar": "^2.0.0-alpha.8-1", "@angular2-material/progress-circle": "^2.0.0-alpha.8-1", "@angular2-material/radio": "^2.0.0-alpha.8-1", "@angular2-material/sidenav": "^2.0.0-alpha.8-1", "@angular2-material/slide-toggle": "^2.0.0-alpha.8-1", "@angular2-material/slider": "^2.0.0-alpha.8-1", "@angular2-material/tabs": "^2.0.0-alpha.8-1", "@angular2-material/toolbar": "^2.0.0-alpha.8-1", "@angular2-material/tooltip": "^2.0.0-alpha.8-1",

Module: ` import { NgModule, ModuleWithProviders } from ‘@angular/core’;

import { MdButtonModule } from ‘@angular2-material/button’; import { MdButtonToggleModule } from ‘@angular2-material/button-toggle’; import { MdCardModule } from ‘@angular2-material/card’; import { MdCheckboxModule } from ‘@angular2-material/checkbox’; import { MdGridListModule } from ‘@angular2-material/grid-list’; import { MdIconModule } from ‘@angular2-material/icon’; import { MdInputModule } from ‘@angular2-material/input’; import { MdListModule } from ‘@angular2-material/list’; import { MdMenuModule } from ‘@angular2-material/menu’; import { MdProgressBarModule } from ‘@angular2-material/progress-bar’; import { MdProgressCircleModule } from ‘@angular2-material/progress-circle’; import { MdRadioModule } from ‘@angular2-material/radio’; import { MdSidenavModule } from ‘@angular2-material/sidenav’; import { MdSliderModule } from ‘@angular2-material/slider’; import { MdSlideToggleModule } from ‘@angular2-material/slide-toggle’; import { MdTabsModule } from ‘@angular2-material/tabs’; import { MdToolbarModule } from ‘@angular2-material/toolbar’; import { MdTooltipModule } from ‘@angular2-material/tooltip’; import { // MdLiveAnnouncer, MdRippleModule, RtlModule, PortalModule, OverlayModule } from ‘@angular2-material/core’;

const MATERIAL_MODULES = [ MdButtonModule, MdButtonToggleModule, MdCardModule, MdCheckboxModule, MdGridListModule, MdIconModule, MdInputModule, MdListModule, MdMenuModule, MdProgressBarModule, MdProgressCircleModule, MdRadioModule, MdRippleModule, MdSidenavModule, MdSliderModule, MdSlideToggleModule, MdTabsModule, MdToolbarModule, MdTooltipModule, OverlayModule, PortalModule, RtlModule, ];

@NgModule({ imports: MATERIAL_MODULES, exports: MATERIAL_MODULES }) export class MdModule { static forRoot(): ModuleWithProviders { return { ngModule: MdModule }; } } `

app.component.html <md-content> <md-toolbar color="primary"> <span>{{ title }}</span> </md-toolbar> </md-content>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
fxckcommented, Jan 5, 2017

no

0reactions
angular-automatic-lock-bot[bot]commented, Sep 5, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Material design component "is not a known element" in Angular2
When I insert a button into the template like this <md-button>foo</md-button> the application starts crashing with this console message
Read more >
'md-dialog-content' is not a known element - Google Groups
I keep getting this error: 'md-dialog-content' is not a known element: 1. If 'md-dialog-content' is an Angular component, then verify that it is...
Read more >
NG8001: 'mat-icon' is not a known element - YouTube
✓ NG8001: 'mat-icon' is not a known element : Error occurs in the template of component xxComponent. 13K views 1 year ago. CodeDocu ......
Read more >
Directives > mdContent - AngularJS Material
The <md-content> directive is a container element useful for scrollable content. It achieves this by setting the CSS overflow property to auto so...
Read more >
mdb-icon is not a known element - Material Design for Bootstrap
If 'mdb-icon' is an Angular component, then verify that it is part of this module. · If 'mdb-icon' is a Web Component then...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found