-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix broken scope walking #183
Comments
Thanks. On my list for monday. |
Just to make sure I understand, you have something like I'm not sure what we should do here. In some ways an error seems right. An example might be: var scope = new Scope({});
scope.read("../key",{ ... }) Should we warn or error? Thoughts @phillipskevin / @chasenlehara / @matthewp ? |
An error or warning might say:
|
With leakScope a template might be used in cases where there is a parent context and in other cases where there is not, so I think a warning. |
I think we are stumbling upon a bug in this line.
The code in
scope.read
goes likeHere parent will be undefined at some point and
parent.isSpecial()
withI'd go with
while (parent && parent.isSpecial())
or something similar.For some context: we are trying to use something like
{{#if(myList.length)}}
or{{#if(../myList.length)}}
in a stache view. The workround is adding a./
or athis.
to the reference like{{#if(./myList.length)}}
.I know that we could and should use
{{#each(myList}}...{{else}}...{{/each}}
, but sometimes we either don't want to iterate or have a different reason for checking the length of a list before iterating over it, e.g. in a<ul>
context.The text was updated successfully, but these errors were encountered: