Angled core module error

0

I am implementing the CORE module but it is giving error: ERROR in: Unexpected value 'CoreModule in C: /dev/master/src/app/core/core.module.ts' imported by the module' AppModule in C: / dev / migration-radios / new / master / src / app / app.module.ts'. Please add a @NgModule annotation.

// app.module

import { BrowserModule } from "@angular/platform-browser";
import { NgModule, LOCALE_ID } from "@angular/core";

import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";

import { PLATFORM_ID, APP_ID, Inject } from "@angular/core";
import { isPlatformBrowser, DatePipe } from "@angular/common";
import { FooterComponent } from "./components/footer/footer.component";
import { PlayerComponent } from "./components/player/player.component";
import { HeaderComponent } from "./components/header/header.component";
import { HeaderBandComponent } from "./components/header-band/header-band.component";
import { SharedModule } from "./shared/shared.module";
import { CoreModule } from "./core/core.module";
import { HttpModule } from "@angular/http";

@NgModule({
  declarations: [
    AppComponent,
    HeaderComponent,
    HeaderBandComponent,
    FooterComponent,
    PlayerComponent
  ],
  imports: [
    BrowserModule.withServerTransition({ appId: "Radios" }),
    AppRoutingModule,
    HttpModule,
    SharedModule,
    CoreModule
  ],
  providers: [{ provide: LOCALE_ID, useValue: "pt-BR" }],
  bootstrap: [AppComponent]
})
export class AppModule {
  constructor(
    @Inject(PLATFORM_ID) private platformId: Object,
    @Inject(APP_ID) private appId: string
  ) {
    const platform = isPlatformBrowser(platformId)
      ? "in the browser"
      : "on the server";
    console.log('Running ${platform} with appId=${appId}');
  }
}

// core.module

import { NgModule } from "@angular/core";

import { ColumnistService } from "../services/columnist.service";
import { AlertService } from "../services/alert.service";
import { FormService } from "../services/form.service";
import { HttpUtilService } from "../services/http-util.service";
import { LiveService } from "../services/live.service";
import { NewsService } from "../services/news.service";
import { PlayerService } from "../services/player.service";
import { PodcastService } from "../services/podcast.service";
import { ProgramsService } from "../services/programs.service";
import { RadioService } from "../services/radio.service";
import { SchedulerService } from "../services/scheduler.service";
import { SportService } from "../services/sport.service";
import { TeamService } from "../services/team.service";

NgModule({
  providers: [
    ColumnistService,
    AlertService,
    FormService,
    HttpUtilService,
    LiveService,
    NewsService,
    PlayerService,
    PodcastService,
    ProgramsService,
    RadioService,
    SchedulerService,
    SportService,
    TeamService
  ]
});
export class CoreModule {}
    
asked by anonymous 12.10.2018 / 04:50

1 answer

0

@ is missing from annotation NgModule . Here is the correct code:

import { NgModule } from "@angular/core";

import { ColumnistService } from "../services/columnist.service";
import { AlertService } from "../services/alert.service";
import { FormService } from "../services/form.service";
import { HttpUtilService } from "../services/http-util.service";
import { LiveService } from "../services/live.service";
import { NewsService } from "../services/news.service";
import { PlayerService } from "../services/player.service";
import { PodcastService } from "../services/podcast.service";
import { ProgramsService } from "../services/programs.service";
import { RadioService } from "../services/radio.service";
import { SchedulerService } from "../services/scheduler.service";
import { SportService } from "../services/sport.service";
import { TeamService } from "../services/team.service";

@NgModule({
  providers: [
    ColumnistService,
    AlertService,
    FormService,
    HttpUtilService,
    LiveService,
    NewsService,
    PlayerService,
    PodcastService,
    ProgramsService,
    RadioService,
    SchedulerService,
    SportService,
    TeamService
  ]
});
export class CoreModule {}
    
14.10.2018 / 20:06