-
Notifications
You must be signed in to change notification settings - Fork 339
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
Index not working inside a if #220
Comments
By the way I'm aware that I can access the index through #parent.index, but it seems counterintuitive that index would refer to the {{if}} in that context, and not the {{for}}. |
Yes, this is a duplicate of the very last issue, at #219, and of several others (#96, #97, or #217). Take a look at them for responses. (It's always best to look at existing issues before creating new ones...)
Yet another one is
|
Hi, Thanks for the (very) quick response. I looked at open issues before posting, but I must admit I didn't search the closed ones. My bad, sorry for the duplicate. We've been using jsrender for over a year and we love it. But the number of duplicates seems to indicate I'm not the only one expecting the index property to refer to the for. I understand that it refers to the current view context (that's why I used parent.index), but maybe you could consider making un-indexed views either inherit the index from their parent, or crawl back the tree to the nearest indexed view. It's just a suggestion, but as a user that's the behaviour I'd expect. |
Yes see my updated reply just above. That exists - it is I agree a lot of folks hit this, but honestly I don't know how to avoid this issue, other than special casing |
Yeah, I left my reply open to answer the phone and replied to your original comment, not the updated one :). |
sure, np |
Closing. |
If I have a {{if}} inside a {{for}}, I don't have access to the index property: http://jsfiddle.net/bLbVg/
(I used the latest version for which I could find a cdn for jsfiddle, but I'm using commit 44 locally and it's not working either.)
Thanks.
The text was updated successfully, but these errors were encountered: