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
Question about partial context (v3.0.0 ~ v4.0.5) #1139
Comments
So basically this is all working as expected. |
Thank you for your answers. But for 2. , if partials should prevent context change, then the outer partial block should not change the context, right? (the inner partial block should follow the same rule with outer partial block, now their behaviors are different) |
Partials CAN change the context, but if they don't, then a new depth is not created. This matches the behavior you see with |
After some tests I found more issues. Refer to this jsfiddle: http://jsfiddle.net/ymd1dg7o/ A. compare 1. with 3. , their behaviors are different. Something strange in v3.0.0 ~ v4.0.5 (maybe it is a designed change?) ; here is another test with v2.0.0, http://jsfiddle.net/20sz0jbf/ . We can pass original context into partial by The issue title will be changed from |
It looks like these issues spawn from the use of stringParams, which we did not account for when we were making the changes to depth handling. If you remove the stringParams option or run against the latest in master the results are all as expected Closing this since stringParams will be desupported in 5, see #1145 |
Thank you for the clarify! |
Question 1: Can we use partial block inside a partial block?
Question 2: When the outer partial block pushed 1 context stack (need to use ../ to refer to original context) , why the inner partial block did not change the context stack? Please refer to this jsfiddle: http://jsfiddle.net/z3fwhmwL/
Template:
Data:
Output:
My Expectation:
Question 3: When a partial provided for the outer partial block, the context is gone. Why? Please refer to this jsfiddle: http://jsfiddle.net/z3fwhmwL/1/
Provided partial:
Output:
Question 4: When a partial provided for the inner partial block, the context is gone. Why? Please refer to this jsfiddle: http://jsfiddle.net/z3fwhmwL/2/
Provided partial:
Output:
The text was updated successfully, but these errors were encountered: