Problem
Currently there is no way to pass dynamic parameters to certain Template Helpers. I'll call out the query-params helper in this case as an example.
Typically we'd use it in the following way:
{{#link-to 'route' (query-params sort="asc" status="complete")}}
Which would give us a link to /route?sort=asc&status=complete
This works well, but there is no way to pass a set of dynamic values to the helper. If we have the following in a component:
params: {
sort: 'asc',
status: 'complete'
}
You can't destructure the parameters in the template:
{{#link-to 'route' (query-params params)}}
Solution
We should add support for a spread operator (similar to the one in javascript) for use in templates.
I would see something like this looking like:
{{#link-to 'route (query-params ...params)}}
Which would end up being the same as:
{{#link-to 'route' (query-params sort="asc" status="complete")}}
But would allow us to change params and have it reflect in the helper.
Problem
Currently there is no way to pass dynamic parameters to certain Template Helpers. I'll call out the
query-paramshelper in this case as an example.Typically we'd use it in the following way:
Which would give us a link to
/route?sort=asc&status=completeThis works well, but there is no way to pass a set of dynamic values to the helper. If we have the following in a component:
You can't destructure the parameters in the template:
Solution
We should add support for a spread operator (similar to the one in javascript) for use in templates.
I would see something like this looking like:
Which would end up being the same as:
But would allow us to change
paramsand have it reflect in the helper.