-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc(routing): explain activation strategies #475
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a missing space before `invoke...
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the help. I did so.
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.