emberjs / emberjs/ember.js

`Transition.to` does not expose default query param values

Open
#18,021 0 comments 3 reactions 0 assignees View on GitHub
Routing
Dominant language
TypeScript
Stars
22.6k
Forks
4.2k
Avg merge
3d 12h
Merged PRs (30d)
15

Description

Given the following application controller:

**application/controller.js**
```javascript
export default Controller.extend({
queryParams: ['foo'],
foo: 'bar',
});
```

And the following application route:

**application/route.js**
```javascript
export default Route.extend({
queryParams: {
foo: { refreshModel: true },
},

model(params, { to: { queryParams } }) {
console.log(params); // {foo: "bar"}
console.log(queryParams); // {}
}
});
```

After navigating to `/`, I was expecting both `console.log()` calls to output the same hash.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.