How to pass array data from router to template page javascript


I have an array of images in my router that would like to pass to my photo browser that i have in template page java script section. I can not figure how I can pass that array. I am adding images product array and then passing it to context.

router code:
componentUrl: ‘./pages/product.html’,
context: {
product: product,

In template I have tried:

I get error:
VM1695:5 Uncaught ReferenceError: product is not defined

I can loop over image array in html and that works fine.

{{#each product.images}}


Help much appreciated.


After playing around with it for a while I found that I can pass array from router via
Is there a better approach?

It depends on context, but with should be also fine