简体   繁体   中英

Accessing nested objects in array using each helper in handlebars

I have data in this format

"numbers":[
        {
            "callFlow":{
                "type":"RING-ONE"
            },
            "number":"111111111"
        }
 ]

and my html looks likes this

{{#each numbers}}
{{number}}
{{callFlow.type}}
{{/each}}

Expected Output is

111111111
RING-ONE

But I get Output as

111111111

This is what you are looking for:

{{#each numbers}}
 {{this.number}}
 {{this.callFlow.type}}
{{/each}}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM