Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What's the difference between
Dict "Context" $.root.Context
andDict "ctx" $.root
? I can seeDict "ctx" $.root
below, which is using$.root
as the ctx directly.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.
Dict "Context" $.root.Context
allows us to use$.Context
in the underlying template.Dict "ctx" $.root
allows us to use$.ctx
in the underlying template.This is a data map,
Dict
could help to compose them into the data map.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.
I know that basic knowledge.
I mean What's the difference between
Dict "Context" $.root.Context
andDict "ctx" $.root
?Why not use
Dict "Context" $.root
since the$.root
is also a context used widely in this template?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.
if we use
Dict "Context" $.root
, then we need$.Context.Context
in the underlying template.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.
OK, I think I know the problem now.
$.root
is a map (not a Context interface),Dict "ctx" $.root
is passing the map as namectx
, it's not a real context.The naming is quite misleading .......