I am quite new to Angular 5 and I downloaded this starter template:
Angular 5 - Firebas starter template
I have a dashboard component where I want to implement a chartjs component.
My dashboard.module.ts:
import { DashboardPageComponent } from './dashboard-page.component';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', pathMatch: 'full', component: DashboardPageComponent },
]),
],
declarations: [DashboardPageComponent],
})
export class DashboardModule {}
And here the dashboard.component.html template:
<div class="container">
<h1>Your Todo List</h1>
<ul class="list-group">
<p>test</p>
</ul>
// HERE I WANT TO USE THE CHART COMPONENT
<line-chart-component></line-chart-component>
</div>
Here is the linechart component:
import { Component, OnInit } from '@angular/core';
import * as Chart from 'chart.js'
@Component({
selector: 'line-chart-component',
templateUrl: './line-chart.component.html'
})
export class LineChartComponent {
constructor() { }
}
And the linechart html:
<div class="container">
<h1>TESTCOMPONENT</h1>
</div>
And the chart module:
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { LineChartComponent } from './line-chart.component';
@NgModule({
declarations: [LineChartComponent],
// export: [LineChartComponent],
})
export class LineChartModule {}
But the export declaration is not assignable to parameter of type "NgModule"
How can I use the chart component in the dashboard component?