Using Handlebars `@ index` inside a component



  • Hey, I'm currently trying to create a Footer component using a Wrapper
    (example here: https://playground.jsreport.net/w/SimonHenz97/xUvBgfdJ)

    The Issue is I'm using a #each inside the component, but the children don't have access to it I think it loses the context of 0 when "inserting" the children, is there a way to modify my code to give access to the 0?



  • I'm not sure how to fix it. It is too abstract. However the problem is the following...

    async function componentWrapper(name, opts) {
        // here you let evaluate the `Number: {{1}}` code, but the `#each` haven't even started
        const childValue = await jsreport.templatingEngines.waitForAsyncHelper(opts.fn(this))
        // here you invoke `Footer` component with each
        return component.call({
            ...opts.data,
            child: childValue
        }, name, opts)
    }
    

Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.