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

@index doesnt work as array index #605

Closed
saumitrabhave opened this issue Aug 21, 2013 · 1 comment
Closed

@index doesnt work as array index #605

saumitrabhave opened this issue Aug 21, 2013 · 1 comment

Comments

@saumitrabhave
Copy link

when I use @Index to index into an array like
{{this.[@Index]}}
I get an empty response

Following is my Code

Data Object

var aaMatrix = {
        device : ["iPhone","iPad","iPadMini"],
        os : ["iOS4","iOS5"],
        matrix : [
                  [{data:true},{data:true}],
                  [{data:true},{data:true}],
                  [{data:false},{data:false}]
                 ]
};

Template:

<script id="Tmpl" type="text/x-handlebars-template">
<table id = "table">
        {{#each matrix}}
            <tr id = "{{@index}}">
                    <td>{{this.[@index]}}</td> <!--also tried <td>{{this.[{{@index}}]}}</td> -->
                    {{#each this}}
                    <td id = "{{@index}}">
                        {{#if this.data}}
                            yes
                        {{else}}
                            No
                        {{/if}}
                    </td>
                {{/each}}
            </tr>
        {{/each}}
</table>
</script>
@kpdecker
Copy link
Collaborator

This is a known issue. Checkout #569 for workaround and future status.

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

No branches or pull requests

2 participants