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

data-sly-list and data-sly-repeat iteration control #55

Closed
raducotescu opened this issue May 25, 2018 · 1 comment
Closed

data-sly-list and data-sly-repeat iteration control #55

raducotescu opened this issue May 25, 2018 · 1 comment
Assignees
Milestone

Comments

@raducotescu
Copy link
Member

Both data-sly-list and data-sly-repeat should be enhanced to provide iteration control through the following additional expression options:

  • begin - iteration begins at the item located at the specified index; first item of the collection has index 0
  • step - iteration will only process every step items of the collection, starting with the first one
  • end - iteration ends at the item located at the specified index (inclusive)

Example usage:

<!--/* Iterate the collections starting from the element at index 5 (6th element), jumping every 5 elements, until index 100 */-->
<ul data-sly-list="${collection @ begin = 5, step = 5, end = 100}">
    <li>${item}</li>
</ul>
<section data-sly-repeat="${collection @ begin = 5, step = 5, end = 100}">${item}</section>
@raducotescu raducotescu self-assigned this May 25, 2018
@raducotescu raducotescu added this to the 1.4 milestone May 25, 2018
@raducotescu
Copy link
Member Author

Added to spec in e9a4d27 and 4267b77.

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

No branches or pull requests

1 participant