I am new in Angular2. I have tried to create a component but showing an error.
This is the app.component.ts
file.
import { Component } f
MyComponentComponent
in MyComponentModule
MyComponentComponent
to exports
attribute of MyComponentModule
mycomponentModule.ts
@NgModule({
imports: [],
exports: [MyComponentComponent],
declarations: [MyComponentComponent],
providers: [],
})
export class MyComponentModule {
}
MyComponentModule
to your AppModule imports
attributeapp.module.ts
@NgModule({
imports: [MyComponentModule]
declarations: [AppComponent],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
Important If your still have that error, Stop your server ctrl+c
from terminal, and run it again ng serve -o