Skip to content

Instantly share code, notes, and snippets.

@lcpriest
lcpriest / dynamic-query-params.md
Last active November 1, 2018 12:43
EmberJS dynamic query params

I was attempting to generate a list of links and found that some of them needed query params and others didn't. I could not find a recommended way to pass in a dynamic query-params object to the link-to helper. I ended up finding a solution in the Ember Discourse and decided to make it into an ember helper.

Helper:

import Ember from 'ember';

export function dynamicParams([routeName, params]/*, hash*/) {
 return [