Closed timkendrick closed 10 years ago
Thank you!
I added some tests. Feel free to flesh these out.
https://github.com/xxgreg/mustache/commit/e9c2bb793b9093123afa7d05427096090d639c70
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.
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!
Updated to version 0.1.17 http://pub.dartlang.org/packages/mustache
This allows templates to access list items by index, as discussed in https://github.com/janl/mustache.js/issues/158.
Example usage: {{#myList.0}} {{/myList.0}}