* docs(toh-6/dart): refactoring of 'add, edit, delete heroes' Refactoring of "add, edit, delete heroes" section of toh-6 from one big bottom-up step into small independent feature slices, where the user achieves a "milesone" (i.e., can run the full app) after each feature section. The section rewrite is shorter and offers a better UX. Other simplifications: - Error handling is consistent: in the hero service we log to the console, everwhere else we just let errors bubble up. - Hero service methods renamed based on function (create, update) rather then lower-level implementation (post, put). - @Output properties have been eliminated (since they weren't explained). E2E tests now pass on both the TS and Dart sides. * docs(toh-6/ts): refactoring of 'add, edit, delete heroes' Refactoring of "add, edit, delete heroes" section of toh-6 from one big bottom-up step into small independent feature slices, where the user achieves a "milesone" (i.e., can run the full app) after each feature section. The section rewrite is shorter and offers a better UX. Other simplifications: - Error handling is consistent: in the hero service we log to the console, everwhere else we just let errors bubble up. - Hero service methods renamed based on function (create, update) rather then lower-level implementation (post, put). - @Output properties have been eliminated (since they weren't explained). E2E tests now pass on both the TS and Dart sides. Post-Dart-review updates included. * docs(toh-6): ward tweaks
59 lines
1.6 KiB
TypeScript
59 lines
1.6 KiB
TypeScript
// #docplaster
|
|
// #docregion
|
|
// #docregion rxjs-extensions
|
|
import './rxjs-extensions';
|
|
// #enddocregion rxjs-extensions
|
|
|
|
// #docregion v1, v2
|
|
import { NgModule } from '@angular/core';
|
|
import { BrowserModule } from '@angular/platform-browser';
|
|
import { FormsModule } from '@angular/forms';
|
|
import { HttpModule } from '@angular/http';
|
|
|
|
// #enddocregion v1
|
|
// Imports for loading & configuring the in-memory web api
|
|
import { InMemoryWebApiModule } from 'angular2-in-memory-web-api';
|
|
import { InMemoryDataService } from './in-memory-data.service';
|
|
|
|
// #docregion v1
|
|
import { AppComponent } from './app.component';
|
|
import { DashboardComponent } from './dashboard.component';
|
|
import { HeroesComponent } from './heroes.component';
|
|
import { HeroDetailComponent } from './hero-detail.component';
|
|
import { HeroService } from './hero.service';
|
|
// #enddocregion v1, v2
|
|
import { HeroSearchComponent } from './hero-search.component';
|
|
// #docregion v1, v2
|
|
import { routing } from './app.routing';
|
|
|
|
@NgModule({
|
|
imports: [
|
|
BrowserModule,
|
|
FormsModule,
|
|
HttpModule,
|
|
// #enddocregion v1
|
|
// #docregion in-mem-web-api
|
|
InMemoryWebApiModule.forRoot(InMemoryDataService),
|
|
// #enddocregion in-mem-web-api
|
|
// #docregion v1
|
|
routing
|
|
],
|
|
// #docregion search
|
|
declarations: [
|
|
AppComponent,
|
|
DashboardComponent,
|
|
HeroDetailComponent,
|
|
HeroesComponent,
|
|
// #enddocregion v1, v2
|
|
HeroSearchComponent
|
|
// #docregion v1, v2
|
|
],
|
|
// #enddocregion search
|
|
providers: [
|
|
HeroService,
|
|
],
|
|
bootstrap: [ AppComponent ]
|
|
})
|
|
export class AppModule {
|
|
}
|