We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Related to: https://forums.bitovi.com/t/for-of-last-item/1062/3
If you use https://canjs.com/doc/can-stache.addLiveHelper.html, you should be able to make a simple ifLast like:
ifLast
{{#for(item of itemsArray)}} <p {{#ifLast}}class="last"{{/ifLast}}>{{item}}</p> {{/for}}
But we'd need a way to lookup the array and list on the scope. Perhaps something like:
stache.registerLiveHelper("ifLast", function(options){ var index = options.scope.get("scope.index"); var list = options.scope.get("scope.forOfList") return index === list.length - 1 ? options.fn() : options.inverse(); })
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Related to: https://forums.bitovi.com/t/for-of-last-item/1062/3
If you use https://canjs.com/doc/can-stache.addLiveHelper.html, you should be able to make a simple
ifLast
like:But we'd need a way to lookup the array and list on the scope. Perhaps something like:
The text was updated successfully, but these errors were encountered: