aurelia / aurelia/documentation
singleton view-models and their child containers
- Dominant language
- No language data
- Stars
- 104
- Forks
- 108
- PR merge metrics
- No merged PRs in 30d
Description
The section on containers says: "Each time the Router navigates to a screen, it creates a child container to encapsulate all the resources related to that navigation event and then auto-registers the screen's view-model in that child container. As you know, auto-registration, by default, results in the view-model being registered as a singleton."
This is misleading because apparently the child container in which the view-model is registered is not itself a singleton and is disposed when the router navigates to another view. Thus, though the view-model may be a singleton, it does not appear to behave as one.
@singleton could be referenced here, with a clear description of what both true _and_ false parameters mean for view-models.
Contributor guide
Research direction
Locate the documentation section containing the quoted container and auto-registration explanation, then review the @singleton guidance referenced in the issue. Clarify how the true and false parameters affect view-models and explain the child container lifecycle so the documentation accurately describes the resulting behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100