Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Adding support for changing dynamic segments. #27

Merged
merged 1 commit into from
Aug 15, 2015

Conversation

gmurphey
Copy link
Contributor

Currently if you change a dynamic segment in a URL the applicationController.currentRouteName remains the same (e.g., if a URL changes from /users/poteto to /users/gmurphey, the currentRouteName remains users.user).

Unfortunately, the ApplicationController only has access to currentRouteName and currentPath; neither of which is aware of dynamic segments. The easiest way to get around this was to inject route:application into component:bread-crumbs, where you can access applicationRoute.router.url, and base crumb computation off changes to the url.

@poteto
Copy link
Owner

poteto commented Jun 17, 2015

Hey, thanks! This is failing because EnumerableUtils is no longer a thing in the beta channel, I'll fix it and update the develop branch, and rebasing this PR should then be OK.

Blocked by #28

@@ -35,8 +35,9 @@ export default Component.extend({
classNameBindings: [ 'breadCrumbClass' ],
hasBlock: computed.bool('template').readOnly(),
currentRouteName: computed.readOnly('applicationController.currentRouteName'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this line now

@poteto poteto assigned poteto and unassigned poteto Jun 17, 2015
@gmurphey
Copy link
Contributor Author

Thanks! I'll update this and address your notes tonight.

@gmurphey
Copy link
Contributor Author

Blocked by #30.

@poteto
Copy link
Owner

poteto commented Aug 15, 2015

Hold off on the rebase, I'm updating ember-cli

get() {
const currentRouteName = getWithDefault(this, 'currentRouteName', false);
const currentRouteName = getWithDefault(this, 'applicationRoute.controller.currentRouteName', false);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create a computed property for the currentRouteName, much like the one on L31?

@gmurphey
Copy link
Contributor Author

This is rebased with the improvements you noted. Thanks!

@poteto
Copy link
Owner

poteto commented Aug 15, 2015

👍 Thanks @gmurphey! Sorry for dropping the ball on this.

poteto added a commit that referenced this pull request Aug 15, 2015
Adding support for changing dynamic segments.
@poteto poteto merged commit af3ff8a into poteto:develop Aug 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants