I have a problem with rendering custom component. Even if i put my shared module in NgModule it doesnt render. I get an error where it says that i should add component to NgModule or add property schemas with parameter CUSTOM_ELEMENTS_SCHEMA. As i said i added component to shared module and shared module to component where i want to use it. And then i tried with CUSTOM_ELEMENTS_SCHEMA and i got rid of and error but it doesnt render the content of "custom" component it just renders the tag od the comp.
Custom component module
checkbox.module.ts
import { NgModule } from '@angular/core';
import {FormsModule} from '@angular/forms';
import { CheckboxComponent } from './checkbox.component';
@NgModule({
imports: [FormsModule],
exports: [CheckboxComponent],
declarations: [CheckboxComponent]
})
export class CheckboxModule { }
Shared module
shared.module.ts
Edit:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CheckboxModule, CheckboxComponent } from '../components/checkbox';
@NgModule({
imports: [
CommonModule,
CheckboxModule
],
declarations: [],
exports: [ CheckboxComponent ]
})
export class SharedModule { }
Module where i am trying to use shared module and custom component tag:
dashboard.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DashboardComponent } from './dashboard.component';
import { SharedModule } from '../shared/shared.module';
@NgModule({
imports: [
SharedModule,
CommonModule
],
declarations: [DashboardComponent]
})
export class DashboardModule { }
And it renders like a tag with no content
<app-checkbox _ngcontent-c1 name="sth"></app-checkbox>