Handlebars nested 'each' syntax - not iterating over each element

后端 未结 2 990
北恋
北恋 2021-02-01 22:23

I am brand new at this Javascript/JSON/Handlebars thing, and I am having trouble getting a JSON object, with two nested levels, to work in a Handlebars template.

I hav

2条回答
  •  醉梦人生
    2021-02-01 22:50

    There are a couple of changes to suggest, first you shouldn't write an object with several keys { Chapter:, Chapter:, etc...}

    The other suggestion is to review the way Handlebars works, it doesn't need each in every case. Hope it clarifies.

    Try these changes:

    
    
      
        Handlebars Demo
        
        
    
    
    
    
    
    
    

提交回复
热议问题