ember.js - Passing an array as a query parameter to the link-to helper -
i have queryparam in controller array so:
export default ember.controller.extend({ queryparams: ['customfilters'], customfilters: [] // other code goes here } now want link controller , provide 1 or many values customfilters queryparam array so:
{{#link-to 'search' (query-params customfilters=['selection1'])}} custom selection {{/link-to}} unfortunately link-to helper doesn't seem allow me , gives me link search route no query parameters. have 2 questions.
1) should able do?
2) can use link-to helper generate link me or should try , hand roll it?
i'm going assume route link-to has ability update filters wants pass. in routes controller:
export default ember.controller.extend({ arrayoffilters: [ 'jon snow', 'tyrion lannister', 'stannis baratheon' ], somefunctionthatupdatesthearray() {} }); in routes template:
{{#link-to 'search' (query-params customfilters=arrayoffilters)}}i have custom filters!{{/link-to}} in search route controller:
export default ember.controller.extend({ queryparams: ['customfilters'], customfilters: [] })
Comments
Post a Comment