A
A
Alex102142020-07-12 00:28:40
Angular
Alex10214, 2020-07-12 00:28:40

Error in module (Angular) Who can help?

I have "AdminModule" { } highlighted in red, when I hover over "AdminModule" I get this:
TS1219: 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.

I have this line in tsconfig: " experimentalDecorators": true , (I changed this value to folse and there are no results) - don't ask why) I'm a beginner.

Here is the code:

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {RouterModule} from '@angular/router';
import { AdminLayoutComponent } from './shared/components/admin-layout/admin-layout.component';
import { LoginPageComponent } from './login-page/login-page.component';

@NgModule({
  declarations: [AdminLayoutComponent, LoginPageComponent],
  imports: [
    CommonModule,
    RouterModule.forChild([
      {path: '', component: AdminLayoutComponent, children: [
          {path: '', redirectTo: '/admin/login', pathMatch: 'full'},
          {path: 'login', component: LoginPageComponent}
        ]}
    ])
  ],
  exports: [RouterModule]
})
export class AdminModule { }  <--- (Еще раз, AdminModule подчеркнут красным)


Typescript version v3.9.6.
I noticed that on version v3.4.5. This error does not exist.

Please tell me how to solve the problem without changing the TS version. Thanks in advance for reading to the end.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Shvedov, 2020-07-12
@Alex10214

import this module into your AppModule application module, or if this is the root module, then bootstrap, in short, you need to use it somewhere in the project, then the configs from the project will be applied to it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question