zone.js:672未捕获(在承诺中)错误:XHR错误(404 Not Found)正在加载http:// localhost:4200 / angular2 / platform / browser

时间:2018-03-03 03:53:10

标签: angular

当我将角度应用程序加载到本地主机时,会发生以下错误,并且不显示任何内容。

Uncaught (in promise) Error: XHR error (404 Not Found) loading 
http://localhost:4200/angular2/platform/browser
Error loading http://localhost:4200/angular2/platform/browser
at o (system.src.js:4597) [<root>]
at XMLHttpRequest.I.s.onreadystatechange (system.src.js:4597) [<root>]

相关性:

"@angular/animations": "^5.2.7",
"@angular/cdk": "^5.2.3",
"@angular/common": "^5.2.7",
"@angular/compiler": "^5.2.7",
"@angular/core": "^5.2.7",
"@angular/forms": "^5.2.7",
"@angular/http": "^5.2.7-rc.1",
"@angular/material": "^5.2.3",
"@angular/platform-browser": "^5.2.7",
"@angular/platform-browser-dynamic": "^5.2.7",
"@angular/platform-server": "^5.2.7",
"@angular/router": "^5.2.7",
"@angular/upgrade": "2.4.9",
"angular-2-data-table": "^0.1.2",
"angularfire2": "^5.0.0-rc.5-next",
"bootstrap": "^4.0.0",
"chart.js": "2.5.0",
"core-js": "2.4.1",
"firebase": "^4.10.1",
"moment": "2.17.1",
"ng2-bootstrap": "1.4.0",
"ng2-charts": "1.5.0",
"ngx-toastr": "^8.2.1",
"promise-polyfill": "7.1.0",
"rxjs": "^5.5.6",
"ts-helpers": "1.1.2",
"zone.js": "0.7.2"

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { ApplicationRef, NgModule } from '@angular/core';
import { HashLocationStrategy, LocationStrategy } from '@angular/common';
import { CommonModule } from '@angular/common';
 import { FormsModule, NgForm, NgModel, ReactiveFormsModule } from 
'@angular/forms';
import { DropdownModule } from 'ng2-bootstrap/dropdown';
import { TabsModule } from 'ng2-bootstrap/tabs';
import { ChartsModule } from 'ng2-charts/ng2-charts';
import { HttpModule } from '@angular/http';

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

import { SignupComponent } from './auth/signup/signup.component';
import { SigninComponent } from './auth/signin/signin.component';

import { NAV_DROPDOWN_DIRECTIVES } from './shared/nav-dropdown.directive';
import { SIDEBAR_TOGGLE_DIRECTIVES } from './shared/sidebar.directive';
import { AsideToggleDirective } from './shared/aside.directive';
import { BreadcrumbsComponent } from './shared/breadcrumb.component';
import { AppRoutingModule } from './app.routing';
import { FullLayoutComponent } from './layouts/full-layout.component';
import { SimpleLayoutComponent } from './layouts/simple-layout.component';
import { AuthService } from './auth/auth.service';
import { ActivitiesComponent } from './activities/activities.component';

@NgModule({

declarations: [
//    RegisterComponent,
AppComponent,

FullLayoutComponent,
SimpleLayoutComponent,
NAV_DROPDOWN_DIRECTIVES,
BreadcrumbsComponent,
SIDEBAR_TOGGLE_DIRECTIVES,
AsideToggleDirective,
SignupComponent,
SigninComponent,
ActivitiesComponent

 ],
 imports: [
BrowserModule,
AppRoutingModule,
DropdownModule.forRoot(),
TabsModule.forRoot(),
ChartsModule,
CommonModule,
FormsModule,
ReactiveFormsModule,
HttpModule,
],

providers: [AuthService,{
provide: LocationStrategy,
useClass: HashLocationStrategy
}],
bootstrap: [ AppComponent ]
})
export class AppModule { }

命令提示符中没有错误,但是当应用程序加载到localhost时,控制台中会出现错误。我不知道是什么问题。任何帮助将不胜感激。

0 个答案:

没有答案