doc(routing): explain activation strategies#475
doc(routing): explain activation strategies#475Alfhir wants to merge 1 commit intoaurelia:masterfrom Alfhir:alfhir-docs-propsal
Conversation
|
Thank you for your contribution @Alfhir. Would it be possible for you to revert all the changes related purely to Markdown syntax? Those changes make this document different in style from most of the rest of the document and also obscure what the new content is. It looked like it was the addition of a single paragraph at the end only, but I wasn't sure when trying to review. |
|
Sorry for the sloppy PR. It should really only change the paragraph at the end of the document (L1177+): Reusing an Existing View Model. |
| * replace | ||
| * invoke-lifecycle. | ||
|
|
||
| `Replace` does not re-use the existing view-model, i.e. you get a new instance of product. This is less performant but if your view model builds up local state, you will have a clean start.`Invoke-lifecycle` means, invoke the navigation lifecycle. Aurelia then re-uses the View-Model and (only) issues canDeactivate, deactivate, canActivate, activate callbacks on the same instance - e.g. new Product() - when switching from one route to another. This is efficient, but might surprise developers, because the view-model instance is not in a clean state. |
There was a problem hiding this comment.
Pls correct the values to be the correct string used in code, fix Replace to replace, and Invoke-lifecycle to invoke-lifecycle.
There was a problem hiding this comment.
There is a missing space before `invoke... too.
|
I am not that familiar with english grammar, should it be
or
|
|
I guess |
I would like to add the explanation Huochunpeng gave to me in this thread.