0
It turns out I’m trying to use a module and I’m not getting from this error below:
Uncaught Error: Unexpected directive 'BordaCreateComponent' imported by the module 'AppModule'. Please add a @NgModule annotation. at syntaxError
My App.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { UsuarioRoutingModule } from './usuario/usuario-routing.module';
import { UsuarioModule } from './usuario/usuario.module';
import { UsuarioLoginComponent } from './usuario/usuario-login/usuario-login.component';
import { BordaCreateComponent } from './borda/borda-create/borda-create.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import {HttpModule} from '@angular/http';
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
FormsModule,
ReactiveFormsModule,
HttpModule,
NgbModule.forRoot(),
BordaCreateComponent
],
exports: [
AppComponent,
FormsModule,
ReactiveFormsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
My Borda.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AppModule } from '../app.module';
import { BordaRoutingModule } from './borda-routing.module';
import { BordaListComponent } from './borda-list/borda-list.component';
import { BordaCreateComponent } from './borda-create/borda-create.component';
@NgModule({
imports: [
CommonModule,
BordaRoutingModule,
AppModule
],
exports: [
BordaCreateComponent,
BordaListComponent
],
declarations: [BordaCreateComponent, BordaListComponent]
})
export class BordaModule { }
thank you very much, that’s right, I’m studying Angular and still do not understand this business of modules after this became clearer now.
– Ederson Coelho
@And then consider marking the answer as accepted if it has completely solved your problem.
– mercador