Buen día,
Estoy tratando de heredar desde un componente a otro, pero cuando cargo el componente que esta heredando, el angular me bota como error todos los lugares donde he utilizado el ngModule
Nota: Estoy usando Angular 9
Este es el componente del que quiero heredar
@Component({
selector: 'app-reportes-catalogacion',
templateUrl: './reportes-catalogacion.component.html',
styleUrls: ['./reportes-catalogacion.component.scss']
})
export class ReportesCatalogacionComponent implements OnInit {
prueba:string = 'sadad';
constructor(public serviceFactoryGraphicService: ServiceFactoryGraphicService, public text: textoModuloAdm, public spinner: NgxSpinnerService, public ajax: AjaxService, public encript: DycpService) {}
Modulo
import { FormsModule } from '@angular/forms';
@NgModule({
imports: [
CommonModule,
RouterModule.forChild(router),
LayoutModule,
ReactiveFormsModule
, FormsModule
],
exports: [
RouterModule
],
declarations: [
ReportesCatalogacionComponent
],
providers: [
AjaxService
, CreateHighChartService
, ServiceFactoryGraphicService
, AjaxService
],
entryComponents: [
GraphicalAmChardComponent
]
})
Componente al que voy a heredar Trate de inicializar la variable para ver si funcionaba y aun así seguía generando el mismo error agregue el CommonModule y FormsModule al modulo de cada componente y aun así se seguía generando el error, también añadí el BrowserModule al modulo raíz
@Component({
selector: 'app-indicators-default',
templateUrl: './indicators-default.component.html',
styleUrls: ['./indicators-default.component.scss']
})
export class IndicatorsDefaultComponent extends ReportesCatalogacionComponent implements OnInit, AfterViewInit {
constructor(public serviceFactoryGraphicService: ServiceFactoryGraphicService, public text: textoModuloAdm, public spinner: NgxSpinnerService, public ajax: AjaxService, public encript: DycpService) {
super(serviceFactoryGraphicService, text, spinner, ajax, encript);
this.prueba = 'asdasd';
}
}
Modulo
import { FormsModule } from '@angular/forms';
@NgModule({
imports: [
CommonModule,
RouterModule.forChild(router),
LayoutModule,
ReactiveFormsModule,
FormsModule
],
exports: [
RouterModule
],
declarations: [
IndicatorsDefaultComponent
],
providers: [
AjaxService,
CreateHighChartService,
ServiceFactoryGraphicService,
AjaxService
],
entryComponents: [
GraphicalAmChardComponent
]
})