未处理的承诺拒绝:无法读取null的属性'index';区域:<root>;任务:Promise.then;

时间:2017-05-15 11:42:51

标签: .net angular webpack core

升级我的角度现在我得到这个错误,不知道还能转向何处。

  

未处理的承诺拒绝:无法读取null的属性'index';区域:;任务:Promise.then;值:TypeError:无法读取null的属性'index'

 import { VehicleService } from './Services/vehicle.service';
    import { CarComponent } from './components/car/car.component';

    import { SidebarModule } from 'ng-sidebar';

    import { NgModule, ErrorHandler } from '@angular/core';
    import { RouterModule } from '@angular/router';
    import { HttpModule } from '@angular/http';
    import { AppComponent } from './components/app/app.component'
    import { NavMenuComponent } from './components/navmen/navmenu.component';
    import { HomeComponent } from './components/home/home.component';
    import { FetchDataComponent } from './components/fetchdata/fetchdata.component';
    import { CounterComponent } from './components/counter/counter.component';

    import { CarsComponent } from './components/cars/cars.component';

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

    import {InputTextModule,DataTableModule,ButtonModule,DialogModule, SharedModule} from 'primeng/primeng';
    import { PostsComponent } from './components/posts/posts.component';
    import 'rxjs/Rx';
    import 'rxjs/add/operator/toPromise';
    import 'rxjs/add/operator/catch';
    import "rxjs/add/operator/map";
    import { MaterialModule, MdSidenavModule } from '@angular/material';

    import { TieredMenuModule, SlideMenuModule, AccordionModule, PanelModule,     MenuModule, MenubarModule, ToolbarModule, ConfirmDialogModule, ConfirmationService, MultiSelectModule, AutoCompleteModule, CalendarModule, DropdownModule, BreadcrumbModule } from 'primeng/primeng';

    import { MenuItem } from 'primeng/components/common/api';
    import { OutOfStockComponent } from "./components/outofstock/outofstock.component";

    import {ToastyModule} from 'ng2-toasty';

    import { PageHeaderComponent } from "./components/pageheader/page-header.component";
    import { VehicleFormComponent } from './components/vehicle-form/vehicle-form.component';
    import { FormsModule, ReactiveFormsModule } from "@angular/forms";


    import 'hammerjs/hammer';
    import { InventoryComponent } from "./components/inventory/inventory.component";
    import { LoaderComponent } from "./components/loader/loader.component";
    import { CustomerListComponent } from "./components/customer-list/customer-list.component";
    import { CustomerFormComponent } from "./components/customer-form/customer-form.component";
    import { CustomerDetailComponent } from "./components/customer-detail/customer-detail.component";
    import { MyobService } from "./Services/myob.service";
    import MyErrorHandler from "./app.error-hander";
    import { PendingItemsComponent } from "./components/pending-items/pending-items.component";
    import { MenuService } from "./Services/menu.service";
    import { InventoryService } from "./Services/inventory.service";
    import { SalesRepsComponent } from "./components/sales-reps/sales-reps.component";
    import { SalesRepService } from "./Services/sales-rep.service";
    import { SalesRepFormComponent } from "./components/sales-rep-form/sales-rep-form.component";



    @NgModule({
        declarations: [
        AppComponent,
        NavMenuComponent,
        CounterComponent,
        FetchDataComponent,
        HomeComponent,
        CarsComponent,
        PostsComponent,
        OutOfStockComponent,
        InventoryComponent,
        PageHeaderComponent,
        CarComponent,
        VehicleFormComponent,
        LoaderComponent,
        CustomerListComponent,
        CustomerFormComponent,
        CustomerDetailComponent,
        PendingItemsComponent,
        SalesRepsComponent,
        SalesRepFormComponent
    ],
    imports: [
        BrowserModule,// Must be first import. This automatically imports BrowserModule, HttpModule, and JsonpModule too.
        ToastyModule.forRoot(),
        HttpModule,
        FormsModule, 
        ReactiveFormsModule,
        MaterialModule,
        MdSidenavModule,
        BrowserAnimationsModule,
        ButtonModule,BreadcrumbModule,SharedModule,DataTableModule,TieredMenuModule,SlideMenuModule,AccordionModule,PanelModule,MenuModule,MenubarModule,ToolbarModule,ConfirmDialogModule,MultiSelectModule,AutoCompleteModule,CalendarModule,DropdownModule,DialogModule,PanelModule,
        SidebarModule.forRoot(),
        RouterModule.forRoot([
            { path: '', redirectTo: 'home', pathMatch: 'full' },

            { path: 'vehicles/new', component: VehicleFormComponent },
            { path: 'home', component: HomeComponent },
            { path: 'counter', component: CounterComponent },
            { path: 'fetch-data', component: FetchDataComponent },
            { path: 'cars', component: CarsComponent },
            { path: 'posts', component: PostsComponent },
            { path: 'out-of-stock', component: OutOfStockComponent },
            { path: 'epicor-items', component: InventoryComponent },
            { path: 'car', component: CarComponent },
            { path: 'customer-list', component: CustomerListComponent },
            { path: 'customer-form', component: CustomerFormComponent },
            { path: 'customer/detail', component: CustomerDetailComponent },
            { path: 'items/pending', component: PendingItemsComponent },
            { path: 'sales-rep/list', component: SalesRepsComponent },
            { path: 'sales-rep/form/:id', component: SalesRepFormComponent }


            //{ path: '**', redirectTo: 'home' }
        ])
    ],
    exports: [],
    providers:[
                 { provide: ErrorHandler, useClass: MyErrorHandler } ,
        VehicleService,
        MyobService,
        MenuService,
        InventoryService,
        SalesRepService
    ],
    bootstrap: [AppComponent]

    })
    export class AppModule {
}

错误:

vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:99553 Unhandled Promise rejection: Cannot read property 'index' of null ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot read property 'index' of null
    at ComponentFactory_.create (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:10217:101)
    at ComponentFactoryBoundToModule.create (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:3755:29)
    at ApplicationRef_.bootstrap (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:5338:57)
    at http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:5127:79
    at Array.forEach (native)
    at PlatformRef_._moduleDoBootstrap (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:5127:42)
    at http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:5089:27
    at ZoneDelegate.invoke (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:99365:26)
    at Object.onInvoke (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:4456:37)
    at ZoneDelegate.invoke (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:99364:32)
    at Zone.run (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:99157:43)
    at http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:99744:57
    at ZoneDelegate.invokeTask (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:99398:31)
    at Object.onInvokeTask (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:4447:37)
    at ZoneDelegate.invokeTask (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:99397:36) TypeError: Cannot read property 'index' of null
    at ComponentFactory_.create (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:10217:101)
    at ComponentFactoryBoundToModule.create (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:3755:29)
    at ApplicationRef_.bootstrap (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:5338:57)
    at http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:5127:79
    at Array.forEach (native)
    at PlatformRef_._moduleDoBootstrap (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:5127:42)
    at http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:5089:27
    at ZoneDelegate.invoke (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:99365:26)
    at Object.onInvoke (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:4456:37)
    at ZoneDelegate.invoke (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:99364:32)
    at Zone.run (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:99157:43)
    at http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:99744:57
    at ZoneDelegate.invokeTask (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:99398:31)
    at Object.onInvokeTask (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:4447:37)
    at ZoneDelegate.invokeTask (http://localhost:5000/dist/vendor.js?v=7tGHQ5vk9xgU63SQOvSdUFRFa0A-5og7qEiVPBCBbZU:99397:36)

0 个答案:

没有答案