components icon indicating copy to clipboard operation
components copied to clipboard

md-content is not a known element

Open chosroes opened this issue 10 years ago • 9 comments

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 ->] {{ title }} "): AppComponent@0:0 ; Zone: ; 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 ->] {{ title }} "): 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>

chosroes avatar Sep 07 '16 07:09 chosroes

There is no md-content component. You can see list of available components in the readme.

fxck avatar Sep 07 '16 08:09 fxck

@chosroes : There was a as part of the sidenav component. And it was working till before 8.1. (So it's not you doing something wrong.)

RAlfoeldi avatar Sep 07 '16 16:09 RAlfoeldi

<md-content> was never part of the user-facing API for sidenav; it was an internal element in the sidenav's template that was styled. In alpha.8, it was changed to use a css class, as there was no behavior associated with it.

In material2, there's no need to wrap any of your own content in an md-content element.

jelbourn avatar Sep 07 '16 21:09 jelbourn

@jelbourn , is there any possibility to use angular material 1.1 with angular2?

ashishpatel02 avatar Jan 05 '17 12:01 ashishpatel02

no

fxck avatar Jan 05 '17 12:01 fxck

@jelbourn @fxck I'm looking for the release dates of the angular material 2 but not able to find it, any idea on that?

ashishpatel02 avatar Jan 06 '17 05:01 ashishpatel02

hi md-content element appearing and working in sidenav demo page , but it does not working with angular material 2, i got the same problem. how to achieve this?

burhankaraman avatar Apr 07 '17 13:04 burhankaraman

@burhankaraman indeed, angular material and angular materialjs are different projects..

juanvillegas avatar May 06 '17 03:05 juanvillegas

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.