2
I have a functionality module called CategoriasModule
and when I put the class name in the main module’s Imports this error appears:
Uncaught Error: Unexpected value 'Undefined' Imported by the module 'Appmodule'.
When I take the CategoriasModule
of Imports of AppModule
, everything works ok. Is there any way I can use the module regardless in the main module? If not, how do I solve this problem?
app.modulets.:
...
import { CategoriasModule } from './categorias/categorias.module';
...
@NgModule({
declarations: [
AppComponent,
TopoComponent,
HomeComponent,
RodapeComponent,
RestaurantesComponent,
DiversaoComponent,
OfertaComponent,
ComoUsarComponent,
OndeFicaComponent,
DescricaoReduzida,
OrdemCompraComponent,
InfantilComponent,
FitnessComponent,
TeenComponent,
CalcadosComponent,
//CategoriasComponent
BannerSlideComponent,
OrdemCompraSucessoComponent,
//ajustanto o erro ngIf
//
],
imports: [
CategoriasModule,
BrowserModule,
HttpModule,
//ajustanto o erro ngIf
ReactiveFormsModule,
//
RouterModule.forRoot(ROUTES)
],
providers: [
CarrinhoService, { provide: LOCALE_ID, useValue: 'pt-Br' }
],
bootstrap: [AppComponent],
//
schemas: [ CUSTOM_ELEMENTS_SCHEMA,
NO_ERRORS_SCHEMA
]
//
})
export class AppModule { }
categories.modulets.:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CategoriasComponent } from './categorias.component';
import { Categoria01Component } from './categoria01/categoria01.component';
@NgModule({
declarations: [
CategoriasComponent,
Categoria01Component
],
imports: [ CommonModule ],
exports: [],
providers: [],
})
export class CategoriasModule {}
Friend, because you want to put a module, inside the main module?
– Erick Luz