You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
Refresh the browser and the hero data should be successfully loaded from the
145
+
Refresh the browser, and the hero data should be successfully loaded from the
144
146
mock server.
145
147
146
148
<h3 id="!{_h3id}">HTTP !{_Promise}</h3>
@@ -217,23 +219,21 @@ block get-heroes-details
217
219
Although we made significant *internal* changes to `getHeroes()`, the public signature did not change.
218
220
We still return a !{_Promise}. We won't have to update any of the components that call `getHeroes()`.
219
221
220
-
### Add, edit, delete heroes
222
+
Our stakeholders are incredibly pleased with the added flexibility from the API integration, but it doesn't stop there. Next, we want the ability to create new heroes and delete heroes.
221
223
222
-
Our stakeholders are incredibly pleased with the added flexibility from the API integration, but it doesn't stop there. Next we want to add the capability to add, edit and delete heroes.
224
+
But first, let's see what happens now when we try to update a hero's details.
223
225
224
-
We'll start with the edit feature since we have most of the capabilities already.
225
-
226
-
.l-main-section#edit
226
+
.l-main-section
227
227
:marked
228
-
## Persist name changes to the server
228
+
## Update hero details
229
229
230
230
The hero detail view already allows us to edit a hero's name. Go ahead, try
231
231
it now. As we type, the hero name is updated in the view heading, but
232
-
notice what happens when we hit the `Back` button: the edits are lost!
232
+
notice what happens when we hit the `Back` button: the changes are lost!
233
233
234
234
.l-sub-section
235
235
:marked
236
-
Changes weren't lost before, what's happening?
236
+
Updates weren't lost before, what's happening?
237
237
When the app used a list of mock heroes, changes were made directly to the
238
238
hero objects in the single, app-wide shared list. Now that we are fetching data
239
239
from a server, if we want changes to persist, we'll need to write them back to
@@ -336,7 +336,7 @@ block get-heroes-details
336
336
:marked
337
337
### Hero service `delete` method
338
338
339
-
The delete HTTP method will be used to delete heroes and its invocation is like to `put` except for the method name:
339
+
The hero service's `delete` method uses the _delete_ HTTP method to remove the hero from the server:
340
340
341
341
+makeExcerpt('app/hero.service.ts', 'delete')
342
342
@@ -509,7 +509,8 @@ block observable-transformers
509
509
- var _declarations = _docsFor =='dart'?'directives':'declarations'
510
510
- var declFile = _docsFor =='dart'?'app/dashboard.component.ts':'app/app.module.ts'
511
511
:marked
512
-
And finally, we import the `HeroSearchComponent` from `'./hero-search.component.ts'`
Refresh the browser and the hero data should be successfully loaded from the
145
+
Refresh the browser, and the hero data should be successfully loaded from the
144
146
mock server.
145
147
146
148
<h3 id="!{_h3id}">HTTP !{_Promise}</h3>
@@ -217,23 +219,21 @@ block get-heroes-details
217
219
Although we made significant *internal* changes to `getHeroes()`, the public signature did not change.
218
220
We still return a !{_Promise}. We won't have to update any of the components that call `getHeroes()`.
219
221
220
-
### Add, edit, delete heroes
222
+
Our stakeholders are incredibly pleased with the added flexibility from the API integration, but it doesn't stop there. Next, we want the ability to create new heroes and delete heroes.
221
223
222
-
Our stakeholders are incredibly pleased with the added flexibility from the API integration, but it doesn't stop there. Next we want to add the capability to add, edit and delete heroes.
224
+
But first, let's see what happens now when we try to update a hero's details.
223
225
224
-
We'll start with the edit feature since we have most of the capabilities already.
225
-
226
-
.l-main-section#edit
226
+
.l-main-section
227
227
:marked
228
-
## Persist name changes to the server
228
+
## Update hero details
229
229
230
230
The hero detail view already allows us to edit a hero's name. Go ahead, try
231
231
it now. As we type, the hero name is updated in the view heading, but
232
-
notice what happens when we hit the `Back` button: the edits are lost!
232
+
notice what happens when we hit the `Back` button: the changes are lost!
233
233
234
234
.l-sub-section
235
235
:marked
236
-
Changes weren't lost before, what's happening?
236
+
Updates weren't lost before, what's happening?
237
237
When the app used a list of mock heroes, changes were made directly to the
238
238
hero objects in the single, app-wide shared list. Now that we are fetching data
239
239
from a server, if we want changes to persist, we'll need to write them back to
@@ -336,7 +336,7 @@ block get-heroes-details
336
336
:marked
337
337
### Hero service `delete` method
338
338
339
-
The delete HTTP method will be used to delete heroes and its invocation is like to `put` except for the method name:
339
+
The hero service's `delete` method uses the _delete_ HTTP method to remove the hero from the server:
340
340
341
341
+makeExcerpt('app/hero.service.ts', 'delete')
342
342
@@ -509,7 +509,8 @@ block observable-transformers
509
509
- var _declarations = _docsFor =='dart'?'directives':'declarations'
510
510
- var declFile = _docsFor =='dart'?'app/dashboard.component.ts':'app/app.module.ts'
511
511
:marked
512
-
And finally, we import the `HeroSearchComponent` from `'./hero-search.component.ts'`
0 commit comments