我想重复
我添加了
import './rxjs-extensions';
到AppModule
现在看起来像这样:
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 { HeroDetailComponent } from './hero-detail.component';
import { HeroesComponent } from './heroes.component';
import { HeroService } from './hero.service';
import {DashBoardComponent} from "./dashboard.component";
import {AppRoutingModule} from "./app-routing.module";
import {InMemoryWebApiModule} from "angular-in-memory-web-api";
import {InMemoryDataService} from "./in-memory-data.service";
import {HeroSearchComponent} from "./hero-search.component";
@NgModule({
imports: [
BrowserModule,
FormsModule,
AppRoutingModule,
HttpModule,
InMemoryWebApiModule.forRoot(InMemoryDataService)
],
declarations: [
AppComponent,
HeroDetailComponent,
HeroesComponent,
DashBoardComponent,
HeroSearchComponent
],
providers: [
HeroService
],
bootstrap: [AppComponent]
})
export class AppModule {
}
当我启动应用程序时,我在浏览器控制台中看到错误:
Failed to load resource: the server responded with a status of 404 (Not Found)
zone.js:229 Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:3000/app/rxjs-extensions.js
Error: XHR error (404 Not Found) loading http://localhost:3000/app/rxjs-extensions.js
at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:3000/node_modules/zone.js/dist/zone.js:851:29) [<root>]
at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:151:47) [<root> => <root>]
at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:332:33) [<root>]
Error loading http://localhost:3000/app/rxjs-extensions.js as "./rxjs-extensions" from http://localhost:3000/app/app.module.js
at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:3000/node_modules/zone.js/dist/zone.js:851:29) [<root>]
at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:151:47) [<root> => <root>]
at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:332:33) [<root>]
Error loading http://localhost:3000/app/rxjs-extensions.js as "./rxjs-extensions" from http://localhost:3000/app/app.module.js
我错过了什么?