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
If I have the following data:
data <- list(users = list(list(name = "bob"), list(name = "alice")))
I might want to know if the list is empty or not. For example, this would be my desired template:
template <- "{{#users.length}}Users: {{#users}}{{name}} {{/users}}{{/users.length}}{{^users.length}}No users{{/users.length}}"
It uses .length as a conditional that is true if there are any elements and false if it's empty.
This is not an official standard mustache feature, but it is implemented in some languages. See here for details.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If I have the following data:
I might want to know if the list is empty or not. For example, this would be my desired template:
It uses .length as a conditional that is true if there are any elements and false if it's empty.
This is not an official standard mustache feature, but it is implemented in some languages. See here for details.
The text was updated successfully, but these errors were encountered: