2016-11-30 41 views
0

我和一些朋友正在做一个重要的学校项目一个很好的网络应用程序和嗡嗡声我的app.module.ts中有一些错误,刚刚弹出这是奇怪的,因为我确实有他们和他们不!Angular2 app.module.ts错误

错误:

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. 

这是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 { 
} 

我只是重新克隆整个项目和问题依然存在。我正在使用webstorm最新版本。顺便说一句,我能够npm启动应用程序并运行它我只是无法弄清楚webstorm中的这个错误。该错误从ng模块的第一个括号开始。

+0

如果代码有效,那么这可能只是webstorm的一个问题。你有打字稿所需的所有必要插件吗?看看这里http://www.jetbrains.com/help/webstorm/2016.2/typescript-support.html – peppermcknight

回答

0

这是由一个私有构造函数引起的。