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

issue 106, accessing array inside a loop using the current context #108

Merged
merged 3 commits into from Sep 4, 2012
Merged

issue 106, accessing array inside a loop using the current context #108

merged 3 commits into from Sep 4, 2012

Conversation

jairodemorais
Copy link
Contributor

fix the case 2 from this bug #106.

@travisbot
Copy link

This pull request passes (merged 87d1ad3 into 7e3a258).

@@ -456,6 +456,13 @@ var grammarTests = [
message: "should return a specific array element by index when element is list of primitives"
},
{
name: "Accessing array inside a loop using the current context",
source: '{#list3}{.[0].biz}{/list3}',
context: { "list3": [[ { "biz" : "123" } ], [ { "biz" : "345" } ]]},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add another text case

for list3[$idx].biz

is this part of another PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will send another PR for this!

@vybs
Copy link
Contributor

vybs commented Aug 22, 2012

More test cases to be added

{#groups}
 {@i18n key="three" text="testing for : value is: {skills[.]}......."/}  
 {@i18n key="three" text="testing for : value is: {skills[$idx].name}......."/}
 {@i18n key="three" text="testing for : value is: {skills[$len]}......."/}
{/groups}

This allows random access of an array element outside the current loop
say 2 arrays groups and skills exist and we want to get the skills name of iteration "i" in the groups

@ghost ghost assigned vybs Aug 27, 2012
@vybs
Copy link
Contributor

vybs commented Sep 4, 2012

merging this code change, since it fixes the current issue.

vybs added a commit that referenced this pull request Sep 4, 2012
issue 106, accessing array inside a loop using the current context
@vybs vybs merged commit badd1b7 into linkedin:master Sep 4, 2012
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

3 participants