i am making a component called headerComponent and importing in app.component.ts but getting website/src/app/header/app.headerComponent"' has no exported member 'headerComponent' error my app.headerComponent.ts code is as follow
import { Component } from '@angular/core';
@Component({
selector: 'header',
templateUrl: './app/header/header.html'
})
export class headerComponent {}
and app.component.ts code is as follows
import { Component } from '@angular/core';
import { headerComponent } from './header/app.headerComponent';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
}
You need to add the component to your module.ts
import { headerComponent } from './header/app.headerComponent';
then,
@NgModule({
imports: [
],
declarations: [
headerComponent
]
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