Me and some friends are doing a major school project a nice web app and hum I have some errors in my app.module.ts that just popped up which is weird because I do have them and they don't!
The error :
Error:(32, 11) TS2345:Argument of type '{ imports:typeof BrowserModule[]; exports: typeof SignupFormComponent[]; declarations: (typeof S...' is not assignable to parameter of type 'NgModule'.Types of property 'declarations' are incompatible.Type '(typeof SignupFormComponent | typeof AppComponent | typeof LoaderComponent | typeof MenuComponent...' is not assignable to type '(any[] | Type<any>)[]'.Type 'typeof SignupFormComponent | typeof AppComponent | typeof LoaderComponent | typeof MenuComponent ...' is not assignable to type 'any[] | Type<any>'.Type 'typeof ViewRecipeModalComponent' is not assignable to type 'any[] | Type<any>'.Type 'typeof ViewRecipeModalComponent' is not assignable to type 'Type<any>'.Cannot assign a 'private' constructor type to a 'public' constructor type.
this is the app.module.ts
import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {FormsModule} from '@angular/forms';
import {HttpModule} from '@angular/http';
import './rxjs-extensions';
import {AppComponent} from './app.component';
import {AppRoutingModule, routedComponents} from './app-routing.module';
import {Backend} from './shared/services/backend';
import {MenuComponent} from './menu/menu.component';
import {PlannerComponent} from './planner/planner.component';
import {PlannerMenuComponent} from './planner/planner-menu/planner-menu.component';
import {LoginComponent} from './forms/login/login.component';
import {SignupFormComponent} from './forms/signup/signup-form.component';
import {ListsComponent} from './lists/lists.component';
import {ListEntryControlsComponent} from "./lists/list-entry-controls/list-entry-controls.component";
import {ListEntryFoodComponent} from './lists/list-entry-food/list-entry-food.component';
import {ListEntryRecipeComponent} from './lists/list-entry-recipe/list-entry-recipe.component';
import {ListTopBarComponent} from './lists/list-top-bar/list-top-bar.component';
import {LoaderComponent} from "./loader/loader.component";
import {ListErrorComponent} from "./lists/list-error/list-error.component";
import {RecipeModalComponent} from "./forms/modals/recipe/recipe-modal.component";
import {CreateFoodModalComponent} from "./forms/modals/create-food/create-food-modal.component";
import {ViewRecipeModalComponent} from "./forms/modals/view-recipe/view-recipe-modal.component";
import {Typeahead} from "./forms/typehead/typehead.component";
import {PlannerWeekGridComponent} from "./planner/planner-week-grid/planner-week-grid.component";
import {PlannerWeekCellComponent} from "./planner/planner-week-cell/planner-week-cell.component";
import {DynamicUnitComponent} from "./forms/dynamic-unit/dynamic-unit.component";
import {TagsEditorComponent} from "./forms/tags-editor/tags-editor.component";
import {PromoBooksComponent} from "./books/promo-books/promo-books.component";
@NgModule({
imports: [
BrowserModule,
FormsModule,
AppRoutingModule,
HttpModule
],
exports: [
SignupFormComponent
],
declarations: [
AppComponent,
LoaderComponent,
MenuComponent,
PlannerMenuComponent,
PlannerWeekCellComponent,
PlannerWeekGridComponent,
PlannerComponent,
LoginComponent,
SignupFormComponent,
ListsComponent,
ListErrorComponent,
ListEntryControlsComponent,
ListEntryFoodComponent,
ListEntryRecipeComponent,
ListTopBarComponent,
ViewRecipeModalComponent,
RecipeModalComponent,
CreateFoodModalComponent,
TagsEditorComponent,
Typeahead,
DynamicUnitComponent,
routedComponents,
PromoBooksComponent
],
providers: [
Backend
],
bootstrap: [AppComponent]
})
export class AppModule {
}
I just re-cloned the whole project and the issue persist. I'm using webstorm latest release. By the way, I'm able to npm start the app and run it I just can't figure out this error in webstorm. The error starts at the first bracket of ng module.
这是由私有构造函数引起的。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.