Sha256: bb6682a7548a5c40274ef74ebb03ede9b653f1198b77271c8bb5b214d2c551d5

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

/**
@module ember
*/
import { QueryParams } from '@ember/-internals/routing';
import { assert } from '@ember/debug';
import { assign } from '@ember/polyfills';
import { InternalHelperReference } from '../utils/references';
/**
  This is a helper to be used in conjunction with the link-to helper.
  It will supply url query parameters to the target route.

  Example

  ```handlebars
  {{#link-to 'posts' (query-params direction="asc")}}Sort{{/link-to}}
  ```

  @method query-params
  @for Ember.Templates.helpers
  @param {Object} hash takes a hash of query parameters
  @return {Object} A `QueryParams` object for `{{link-to}}`
  @public
*/
function queryParams({ positional, named }) {
    // tslint:disable-next-line:max-line-length
    assert("The `query-params` helper only accepts hash parameters, e.g. (query-params queryParamPropertyName='foo') as opposed to just (query-params 'foo')", positional.value().length === 0);
    return new QueryParams(assign({}, named.value()));
}
export default function (_vm, args) {
    return new InternalHelperReference(queryParams, args.capture());
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/@ember/-internals/glimmer/lib/helpers/query-param.js