Я новичок в Angular. Я хочу использовать компонент (FuncionariosAlteraSenhaComponent) с маршрутизацией и с диалогом. Однако я не могу импортировать компонент в разные модули.
Я создал shared.module для импорта FuncionariosAlteraSenhaComponent, который будет использоваться в других модулях. Этими двумя модулями являются AppLogged.module и Funcionarios.module. AppLogged.module является родителем Funcionarios.module.
Shared.module
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FuncionariosAlteraSenhaComponent } from '../features/funcionarios/funcionarios-altera-senha/funcionarios-altera-senha.component';
@NgModule({
entryComponents:[
FuncionariosAlteraSenhaComponent],
declarations: [
FuncionariosAlteraSenhaComponent
],
imports: [
CommonModule
],
exports:[
FuncionariosAlteraSenhaComponent
]
})
export class SharedModule { }
AppLogged.module
@NgModule({
entryComponents: [AppLogedComponent, PesquisaColaboradorComponent, EfetuarPagamentoComponent,
PesquisaClienteComponent, PesquisaPedidoComponent, CotacaoVendaComponent, CadastroVeiculoComponent,
PesquisaVeiculoComponent, CompraComponent, CadastroClienteComponent, SolicitarTransferenciaComponent,
SaidaTransferenciaComponent, ConfirmarRecebimentoComponent, PesquisaEstoqueComponent,TextoLivreComponent,
DetalheRecebimentoComponent, PesquisaPedCompraTransfComponent, EfetuarPagamentosComponent],
imports: [
CommonModule,
MatRadioModule,
RouterModule,
HttpClientModule,
ReactiveFormsModule,
FormsModule,
MatFormFieldModule,
MatInputModule,
MatTabsModule,
MatPaginatorModule,
MatTableModule,
MatSortModule,
MatButtonModule,
MatCheckboxModule,
MatDatepickerModule,
MatNativeDateModule,
MatExpansionModule,
MatOptionModule,
MatSelectModule,
LayoutModule,
MatToolbarModule,
MatSidenavModule,
MatIconModule,
MatListModule,
MatAutocompleteModule,
AppLogedRoutingModule,
MatDialogModule,
MatMenuModule,
NgxCurrencyModule,
NgxMaskModule.forRoot(),
],
declarations: [AppLogedComponent, MenuSideComponent, HeaderComponent, PesquisaColaboradorComponent,
EfetuarPagamentoComponent, PesquisaClienteComponent, PesquisaPedidoComponent, CotacaoVendaComponent,
CadastroVeiculoComponent, PesquisaVeiculoComponent,CompraComponent,CadastroClienteComponent,
SolicitarTransferenciaComponent, SaidaTransferenciaComponent, ConfirmarRecebimentoComponent,
PesquisaEstoqueComponent,TextoLivreComponent, DetalheRecebimentoComponent, PesquisaPedCompraTransfComponent, EfetuarPagamentosComponent],
exports: [AppLogedComponent],
})
export class AppLogedModule { }
Funcionarios.module
@NgModule({
entryComponents: [FuncionariosComponent, ],
declarations: [FuncionariosComponent, ],
bootstrap: [FuncionariosComponent, ],
exports: [ FuncionariosComponent, ],
imports: [
CommonModule,
ReactiveFormsModule,
NgxMaskModule,
FormsModule,
RouterModule,
MatFormFieldModule,
MatInputModule,
MatPaginatorModule,
MatTableModule,
MatSortModule,
MatButtonModule,
MatCheckboxModule,
MatDatepickerModule,
MatNativeDateModule,
MatExpansionModule,
MatOptionModule,
MatSelectModule,
MatDialogModule,
MatRadioModule,
MatCardModule,
FuncionariosRoutingModule,
MatAutocompleteModule,
SharedModule ],
})
export class FuncionariosModule { }