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

Marko v3: Custom iterators #193

Closed
patrick-steele-idem opened this Issue Dec 28, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@patrick-steele-idem
Copy link
Contributor

patrick-steele-idem commented Dec 28, 2015

New syntax:

<for(item in ['a', 'b', 'c'] | iterator=data.reverseIterator)>
    ${item}
</for>


<for(item in ['a', 'b', 'c'] | iterator=data.reverseIterator status-var=status)>
    ${status.index}-${item}
</for>

<div for(item in ['a', 'b', 'c'] | iterator=data.reverseIterator)>
    ${item}
</div>


<div for(item in ['a', 'b', 'c'] | iterator=data.reverseIterator  status-var=status)>
    ${status.index}-${item}
</div>

Old syntax:

<for each="item in ['a', 'b', 'c']" iterator="data.reverseIterator">
    ${item}
</for>


<for each="item in ['a', 'b', 'c']" iterator="data.reverseIterator" status-var="status">
    ${status.index}-${item}
</for>

<div for="item in ['a', 'b', 'c']; iterator=data.reverseIterator">
    ${item}
</div>


<div for="item in ['a', 'b', 'c']; iterator=data.reverseIterator; status-var=status">
    ${status.index}-${item}
</div>

@patrick-steele-idem patrick-steele-idem added this to the 3.0 milestone Dec 28, 2015

@patrick-steele-idem

This comment has been minimized.

Copy link
Contributor Author

patrick-steele-idem commented Dec 28, 2015

Work completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.