0

i am trying to generate new module in angular project with

ng g module core/employee-applicant --routing=true

and the new module generated throw an exception

Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.

and in other module it dosn'et generate that error.

the new module with 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){ }

the old module which dose not pop up that 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 { }

and the same thing with the routing module generated with that new module.

and for experimentalDecorators i added it in every tsconfig file in my project

tsconfig.app.json

tsconfig.spec.json

tsconfig.json

tsconfig.base.json

and if anyone can tell me what is the difference between these files

and another thing when i try to import it to app.module it dosen't show up i think it's because of that error

micronyks
  • 54,797
  • 15
  • 112
  • 146
Hassan Ahmed
  • 67
  • 1
  • 12

2 Answers2

1

guys it seems like a bug in visual studio code

i hard imported it in other module by writing the whole path then the error disappear

at least this solve it for me i don't know how ...

Hassan Ahmed
  • 67
  • 1
  • 12
-1

I have the below in my tsconfig.json, and it works fine

   {
    "compilerOptions": {
    "target": "ES5",
     "experimentalDecorators": true
      }
    }
brijesh
  • 760
  • 6
  • 4