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

Templates - introducing $index and $parent #196

Merged
merged 2 commits into from
Nov 5, 2019
Merged

Conversation

nmetulev
Copy link
Contributor

@nmetulev nmetulev commented Nov 5, 2019

PR Type

  • Feature

Description of the changes

This PR introduces new properties in the template context when binding:

  • $index is added to the context of each item being looped with data-for. This is useful when a developer needs to know the index of an item being rendered
  • $parent is added to the context of a template when rendered inside of another template. This is useful when the developer needs to use context from a parent template
  • when looping, all context is preserved. Before only the item being looped was available

This PR also fixes an issue where person-card image was not passed as context to a template.

@nmetulev nmetulev requested a review from vogtn November 5, 2019 02:52
@vogtn vogtn merged commit 51fc9ab into master Nov 5, 2019
@nmetulev nmetulev deleted the nmetulev/template-parent branch November 5, 2019 18:19
@nmetulev nmetulev mentioned this pull request Nov 5, 2019
14 tasks
shweaver-MSFT pushed a commit that referenced this pull request Jun 8, 2020
Templates - introducing $index and $parent
shweaver-MSFT pushed a commit that referenced this pull request Jun 10, 2020
Templates - introducing $index and $parent
shweaver-MSFT pushed a commit that referenced this pull request Jun 10, 2020
Templates - introducing $index and $parent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants