Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

Angular Error: Is it missing an @NgModule annotation?

28.01.2021 (👁8968)

Angular Error: Is it missing an @NgModule annotation?

 

 

Fehlermeldung in ng serve:

Is it missing an @NgModule annotation?

 

 

Lösung:

In app.module.ts muss die neue Componente nicht in imports, sondern in declarations eingetragen werden

VC Code Terminal nach Compiled successfully

Error: src/app/components/spinner2/spinner2.component.ts:9:14 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

   

    Is it missing an @NgModule annotation?

   

    9 export class Spinner2Component implements OnInit {

 

 

 

 

App.module.ts

import { BrowserModule } from '@angular/platform-browser';

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

import { Spinner2Component } from "../app/components/spinner2/spinner2.component";

import { AppComponent } from './app.component';

@NgModule({

  declarations: [

    AppComponent,

    Spinner2Component,

  ],

  imports: [

    BrowserModule,

       

  ],

  providers: [],

  bootstrap: [AppComponent]

})

export class AppModule{ }