I just updated to RC6 and have trouble with the following error:
zone.min.js:1 Unhandled Promise rejection: Template parse errors: 'sidebar' is not a known element: 1. If 'sidebar' is an Angular component, then verify that it is part of this module. 2. If 'sidebar' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message. ("
sidebar
isn't a component. Just a html-tag i am using in one of my templates. They look like this:
...
<sidebar class="main-nav">
...
</sidebar>
...
I tried updating my NgModule AppModule with CUSTOM_ELEMENTS_SCHEMA
like this:
@NgModule({
declarations: [...],
providers: [...],
imports: [BrowserModule, routing, HttpModule, FormsModule, TranslateModule.forRoot()],
bootstrap: [AppComponent],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
})
export class AppModule { }
But that doesn't seem to do anything.
Does anyone haven an idea or a hint?
Thanks to Pankaj Parkar for his comment.
sidebar
seems not to to be accepted yet. I had to implement a workaround.
sidebar.directive.ts
import { Directive } from '@angular/core';
/**
* dummy directive to allow html-tag "sidebar"
*/
@Directive({ selector: 'sidebar'})
export class SidebarDirective {}
Include it in app.module.ts
@NgModule({
declarations: [..., SidebarDirective],
...
})
export class AppModule { }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With