2017-05-25 1 views
2

enter image description hereDies ist kein Fehler. Dies ist nur um den Vorgang abzubrechen Javascript Angular 4

I in Winkel 4.1.2 diese Art von Störung erhalten, ich verstehe nicht, was es kann getan werden, entfernen ... Ich war diese Art von Störung zu erhalten früher in meinem Code und jetzt bin ich NICHT in der Lage, die Änderung in meinem Code zu finden, der diesen Fehler gestartet hat.

Als ich nach Winkel 4 von v2 aktualisiert hat, hat dieser Fehler nicht

kindly Hilfe in verstehen, die Quelle des Fehlers oder mit seiner Lösung beharren verwendet.

Update: Ich habe die Ursache für den Fehler fand heraus, im Grunde habe ich versucht, Lazy Loading-mit NgModule und Routen und dieser Fehler kommt begonnen hat, hier mein Code I Mein app.module Code verwendet wird, ist

import { BrowserModule } from '@angular/platform-browser'; 
import { NgModule } from '@angular/core'; 
import { FormsModule } from '@angular/forms'; 
import { HttpModule, BrowserXhr } from '@angular/http'; 
import { RouterModule, Routes } from '@angular/router'; 
import { appRoutes } from './app.routes'; 
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 

import { AppComponent } from './app.component'; 
import { ContactComponent } from './pages/contact/contact.component'; 
import { HomeComponent } from './pages/home/home.component'; 
import { LoginComponent } from './pages/adviser/login/login.component'; 
import { DashboardModule } from './pages/adviser/dashboard/dashboard.module'; 
import { Page404Component } from './pages/page404/page404.component'; 
import { HttpService } from './shared/services/http.service'; 
import { InstrumentService } from './shared/services/instrument.service'; 
import { WindowRef } from './shared/services/window-ref.service'; 
import { CredentialsService } from './shared/services/credentials.service'; 
import { ConstantService } from './shared/services/constant.service'; 
import { CryptService } from './shared/services/crypt.service'; 
import { AuthGuardService } from './shared/services/auth-guard.service'; 
import { PrivacyPolicyComponent } from './pages/privacy-policy/privacy-policy.component'; 
import { TermsConditionComponent } from './pages/terms-condition/terms-condition.component'; 
import { NgProgressModule, NgProgressCustomBrowserXhr } from 'ngx-progressbar'; 
import { Ng2PageScrollModule } from 'ng2-page-scroll'; 

@NgModule({ 
    declarations: [ 
    AppComponent, 
    ContactComponent, 
    HomeComponent, 
    LoginComponent, 
    Page404Component, 
    PrivacyPolicyComponent, 
    TermsConditionComponent 
    ], 
    imports: [ 
    NgProgressModule, 
    BrowserModule, 
    BrowserAnimationsModule, 
    Ng2PageScrollModule.forRoot(), 
    FormsModule, 
    HttpModule, 
    DashboardModule, 
    RouterModule.forRoot(appRoutes) 
    ], 
    providers: [HttpService, CredentialsService, ConstantService, 
    AuthGuardService, CryptService, WindowRef,InstrumentService, 
    { provide: BrowserXhr, useClass: NgProgressCustomBrowserXhr }], 
    bootstrap: [AppComponent] 
}) 
export class AppModule { } 

Mein app.routes Code

import { Routes } from '@angular/router'; 

import { AppComponent } from './app.component'; 
import { HomeComponent } from './pages/home/home.component'; 
import { LoginComponent } from './pages/adviser/login/login.component'; 
// import { DashboardModule } from './pages/adviser/dashboard/dashboard.module' 
import { Page404Component } from './pages/page404/page404.component'; 
import { AuthGuardService } from './shared/services/auth-guard.service'; 
import { PrivacyPolicyComponent } from './pages/privacy-policy/privacy-policy.component'; 
import { TermsConditionComponent } from './pages/terms-condition/terms-condition.component'; 


export const appRoutes: Routes = [ 
    { path: 'home', component: HomeComponent }, 
    { path: 'login', component: LoginComponent }, 
    { path: 'privacy-policy', component: PrivacyPolicyComponent }, 
    { path: 'terms-condition', component: TermsConditionComponent }, 
    { path: 'dashboard', canActivate: [AuthGuardService], loadChildren:'app/pages/adviser/dashboard/dashboard.module#DashboardModule' }, 
    { path: '', redirectTo: '/home', pathMatch: 'full' }, 
    { path: '**', pathMatch: 'full', component: Page404Component } 
]; 

Meine Übersicht Modul

import { NgModule } from '@angular/core'; 
import { CommonModule } from '@angular/common'; 
import { FormsModule } from '@angular/forms'; 

import { HttpService } from '../../../shared/services/http.service'; 
import { InstrumentService } from '../../../shared/services/instrument.service'; 
import { WindowRef } from '../../../shared/services/window-ref.service'; 
import { CredentialsService } from '../../../shared/services/credentials.service'; 
import { ConstantService } from '../../../shared/services/constant.service'; 
import { CryptService } from '../../../shared/services/crypt.service'; 
import { AuthGuardService } from '../../../shared/services/auth-guard.service'; 
import { AutoCompleteComponent } from '../../../shared/plugin/auto-complete/auto-complete.component'; 
import { MilliToDatePipe } from '../../../shared/pipes/milli-to-date.pipe'; 
import { PercentagePipe } from '../../../shared/pipes/percentage.pipe'; 
import { NseBsePipe } from '../../../shared/pipes/nse-bse.pipe'; 
import { INRCurrencyPipe } from '../../../shared/pipes/inr-currency.pipe'; 
import { NumberFormatPipe } from '../../../shared/pipes/num.pipe'; 
import { RiskPipe } from '../../../shared/pipes/risk.pipe'; 
import { LogPipe } from '../../../shared/pipes/log.pipe'; 
import { ChartsModule } from 'ng2-charts'; 
import { NgProgressModule, NgProgressCustomBrowserXhr } from 'ngx-progressbar'; 
import { Ng2PageScrollModule } from 'ng2-page-scroll'; 
import { InstrumentPipe } from '../../../shared/pipes/instrument.pipe'; 
import { TruncatePipe } from '../../../shared/pipes/truncate.pipe'; 

import { DashboardComponent} from './dashboard.component'; 
import { dashboardRouting } from './dashboard.routing'; 

@NgModule({ 
    imports: [ 
    CommonModule, 
    dashboardRouting, 
    ChartsModule, 
    FormsModule  
    ], 
    declarations: [ 
    DashboardComponent, 
    AutoCompleteComponent, 
    MilliToDatePipe, 
    PercentagePipe, 
    NumberFormatPipe, 
    INRCurrencyPipe, 
    NseBsePipe, 
    RiskPipe, 
    LogPipe, 
    InstrumentPipe, 
    TruncatePipe 
    ], 
    providers: [HttpService, CredentialsService, ConstantService, 
    AuthGuardService, CryptService, WindowRef, InstrumentService] 
}) 
export class DashboardModule { } 

Meine Übersicht Routing

import { ModuleWithProviders } from '@angular/core'; 
import { Routes, RouterModule } from '@angular/router'; 
import { DashboardComponent } from './dashboard.component'; 

const dashboardRoutes: Routes = [ 
    { path: '', component: DashboardComponent } 
]; 

export const dashboardRouting: ModuleWithProviders = RouterModule.forChild(dashboardRoutes); 
+0

Können Sie Ihren Code hinzufügen? – Edric

+0

'jetzt bin ich in der Lage, die Änderung in meinem Code zu finden, der diesen Fehler gestartet hat, also was ist es? –

+0

Sry - ich meine, ich bin nicht in der Lage, die Änderung zu finden –

Antwort

0

Lösung für dieses Problem war - Entfernen faul geladenen Moduls - die in app.module.ts Import Abschnitt importiert wurden

I entfernt 1. DashboardModule.ts und 2. FundsModule .ts aus app.module.ts importieren Abschnitt