How to dynamically set params in link-to

In my current code I am using link-to "routename " quaryparams–,but that routename is given manually .Can I get the route name dynamically in ember as I visited the different route pages.I am using ember 3.0 version

Just use a controller attribute to define the route name.

{{#link-to pathVar }} link {{/link-to}}

pathVar : 'index',

The above code is not working . I used link-to in component . my code


{{ as |menu|}}
{{#menu.item}} {{ pathVar (query-params dateRange=“0”)}}This Week{{/}}
{{/menu.item}} {{/}}


export default Controller.extend({

pathVar : ‘index’, queryParams: [‘dateRange’], dateRange: null,

filterByData: computed(‘dateRange’,‘model’, function(){

let dateRange = this.get('dateRange');    
let expenses = this.get('model'); 
 return expenses;