| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  | // #docplaster
 | 
					
						
							| 
									
										
											  
											
												docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* 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
											
										 
											2016-08-26 14:57:45 -07:00
										 |  |  | // #docregion , imports
 | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  | import { Injectable }    from '@angular/core'; | 
					
						
							| 
									
										
											  
											
												docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* 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
											
										 
											2016-08-26 14:57:45 -07:00
										 |  |  | import { Headers, Http } from '@angular/http'; | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | // #docregion rxjs
 | 
					
						
							|  |  |  | import 'rxjs/add/operator/toPromise'; | 
					
						
							|  |  |  | // #enddocregion rxjs
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import { Hero } from './hero'; | 
					
						
							| 
									
										
											  
											
												docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* 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
											
										 
											2016-08-26 14:57:45 -07:00
										 |  |  | // #enddocregion imports
 | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | @Injectable() | 
					
						
							|  |  |  | export class HeroService { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
											  
											
												docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* 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
											
										 
											2016-08-26 14:57:45 -07:00
										 |  |  |   // #docregion update
 | 
					
						
							|  |  |  |   private headers = new Headers({'Content-Type': 'application/json'}); | 
					
						
							|  |  |  |   // #enddocregion update
 | 
					
						
							| 
									
										
										
										
											2016-06-27 11:23:27 -07:00
										 |  |  |   // #docregion getHeroes
 | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  |   private heroesUrl = 'app/heroes';  // URL to web api
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   constructor(private http: Http) { } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-27 15:00:59 +02:00
										 |  |  |   getHeroes(): Promise<Hero[]> { | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  |     return this.http.get(this.heroesUrl) | 
					
						
							|  |  |  |     // #docregion to-promise
 | 
					
						
							|  |  |  |                .toPromise() | 
					
						
							|  |  |  |     // #enddocregion to-promise
 | 
					
						
							|  |  |  |     // #docregion to-data
 | 
					
						
							| 
									
										
										
										
											2016-05-23 22:24:15 -04:00
										 |  |  |                .then(response => response.json().data as Hero[]) | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  |     // #enddocregion to-data
 | 
					
						
							|  |  |  |     // #docregion catch
 | 
					
						
							|  |  |  |                .catch(this.handleError); | 
					
						
							|  |  |  |     // #enddocregion catch
 | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2016-06-27 11:23:27 -07:00
										 |  |  |   // #enddocregion getHeroes
 | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-27 15:00:59 +02:00
										 |  |  |   getHero(id: number): Promise<Hero> { | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  |     return this.getHeroes() | 
					
						
							| 
									
										
										
										
											2016-07-02 16:13:32 -07:00
										 |  |  |                .then(heroes => heroes.find(hero => hero.id === id)); | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-27 11:23:27 -07:00
										 |  |  |   // #docregion delete
 | 
					
						
							| 
									
										
											  
											
												docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* 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
											
										 
											2016-08-26 14:57:45 -07:00
										 |  |  |   delete(id: number): Promise<void> { | 
					
						
							| 
									
										
										
										
											2016-09-27 12:56:04 -07:00
										 |  |  |     const url = `${this.heroesUrl}/${id}`; | 
					
						
							| 
									
										
											  
											
												docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* 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
											
										 
											2016-08-26 14:57:45 -07:00
										 |  |  |     return this.http.delete(url, {headers: this.headers}) | 
					
						
							|  |  |  |       .toPromise() | 
					
						
							|  |  |  |       .then(() => null) | 
					
						
							|  |  |  |       .catch(this.handleError); | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2016-06-27 11:23:27 -07:00
										 |  |  |   // #enddocregion delete
 | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
											  
											
												docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* 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
											
										 
											2016-08-26 14:57:45 -07:00
										 |  |  |   // #docregion create
 | 
					
						
							|  |  |  |   create(name: string): Promise<Hero> { | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  |     return this.http | 
					
						
							| 
									
										
											  
											
												docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* 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
											
										 
											2016-08-26 14:57:45 -07:00
										 |  |  |       .post(this.heroesUrl, JSON.stringify({name: name}), {headers: this.headers}) | 
					
						
							|  |  |  |       .toPromise() | 
					
						
							|  |  |  |       .then(res => res.json().data) | 
					
						
							|  |  |  |       .catch(this.handleError); | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  |   } | 
					
						
							| 
									
										
											  
											
												docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* 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
											
										 
											2016-08-26 14:57:45 -07:00
										 |  |  |   // #enddocregion create
 | 
					
						
							|  |  |  |   // #docregion update
 | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
											  
											
												docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* 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
											
										 
											2016-08-26 14:57:45 -07:00
										 |  |  |   update(hero: Hero): Promise<Hero> { | 
					
						
							|  |  |  |     const url = `${this.heroesUrl}/${hero.id}`; | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  |     return this.http | 
					
						
							| 
									
										
											  
											
												docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* 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
											
										 
											2016-08-26 14:57:45 -07:00
										 |  |  |       .put(url, JSON.stringify(hero), {headers: this.headers}) | 
					
						
							|  |  |  |       .toPromise() | 
					
						
							|  |  |  |       .then(() => hero) | 
					
						
							|  |  |  |       .catch(this.handleError); | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  |   } | 
					
						
							| 
									
										
											  
											
												docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* 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
											
										 
											2016-08-26 14:57:45 -07:00
										 |  |  |   // #enddocregion put, update
 | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-27 11:23:27 -07:00
										 |  |  |   // #docregion handleError
 | 
					
						
							| 
									
										
										
										
											2016-07-27 15:00:59 +02:00
										 |  |  |   private handleError(error: any): Promise<any> { | 
					
						
							| 
									
										
											  
											
												docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* 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
											
										 
											2016-08-26 14:57:45 -07:00
										 |  |  |     console.error('An error occurred', error); // for demo purposes only
 | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  |     return Promise.reject(error.message || error); | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2016-06-27 11:23:27 -07:00
										 |  |  |   // #enddocregion handleError
 | 
					
						
							| 
									
										
										
										
											2016-04-09 00:18:37 -04:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2016-06-27 11:23:27 -07:00
										 |  |  | 
 |