open-nomad/ui/app/helpers/href-to-spread.js
Alex Dadgar e5ec915ac3 sync
2017-09-19 10:08:23 -05:00

19 lines
518 B
JavaScript

import Ember from 'ember';
import hrefTo from 'ember-href-to/helpers/href-to';
const { Helper } = Ember;
/**
* Href-to Spread
*
* Usage: {{href-to-spread hrefToPositionalParamsAsArray query=whatever}}
*
* Does the same thing as href-to but takes an array of arguments instead of a static list.
* This way arguments can be managed in js and provided to the template.
*/
export default Helper.extend({
compute([params], options = {}) {
return hrefTo.create().compute.call(this, params, options);
},
});