Attempting to create a new module in an Angular project using the command:
ng g module core/employee-applicant --routing=true
Results in an exception being thrown for the newly generated module.
An error message stating, "Experimental support for decorators is a feature subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."
The error only occurs in the new module; it does not appear in other modules.
Code snippet of the new module displaying the error:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { EmployeeApplicantRoutingModule } from './employee-applicant-routing.module';
@NgModule({
declarations: [],
imports: [
CommonModule,
EmployeeApplicantRoutingModule
]
})
export class --> EmployeeApplicantModule (the error on visual studio code red under line){ }
Comparison with an older module that has no such error:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AuthRoutingModule } from './auth-routing.module';
import { LoginComponent } from './login/login.component';
import { MaterialModule } from 'src/app/shared/modules/material.module';
import { PipesModule } from 'src/app/pipes-module';
@NgModule({
declarations: [
LoginComponent
],
imports: [
CommonModule,
AuthRoutingModule,
FormsModule,
ReactiveFormsModule,
MaterialModule,
PipesModule,
]
})
export class AuthModule { }
The issue persists with the routing module generated alongside the new module.
To address the experimentalDecorators
error, I have included it in every tsconfig file within my project:
tsconfig.app.json
tsconfig.spec.json
tsconfig.json
tsconfig.base.json
Any insights into the differences between these files would be appreciated.
Furthermore, when attempting to import the new module into the app.module, it does not show up, possibly due to the presence of the error.