Skip to content
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

Allow list items to be targeted by index #5

Merged
merged 1 commit into from
Jan 12, 2014
Merged

Allow list items to be targeted by index #5

merged 1 commit into from
Jan 12, 2014

Conversation

timkendrick
Copy link
Contributor

This allows templates to access list items by index, as discussed in janl/mustache.js#158.

Example usage: {{#myList.0}} {{/myList.0}}

xxgreg added a commit that referenced this pull request Jan 12, 2014
Allow list items to be targeted by index
@xxgreg xxgreg merged commit 45b3238 into xxgreg:master Jan 12, 2014
@xxgreg
Copy link
Owner

xxgreg commented Jan 12, 2014

Thank you!

I added some tests. Feel free to flesh these out.

e9c2bb7

Also - should this throw a RangeError when the index is out of range, what do other mustache implementations do? I find strict is usually better, but mustache libraries often seem to prefer lenient handling of errors.

If you're happy with this let me know, I'll push it up to pub.

@timkendrick
Copy link
Contributor Author

Great, thanks for adding the tests. I was wondering the same thing about whether to throw a RangeError, feel free to modify the code however you want and push to pub. Thanks!

@xxgreg
Copy link
Owner

xxgreg commented Jan 13, 2014

Updated to version 0.1.17
http://pub.dartlang.org/packages/mustache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants