-
Notifications
You must be signed in to change notification settings - Fork 78
Adding support for changing dynamic segments. #27
Conversation
Hey, thanks! This is failing because
|
@@ -35,8 +35,9 @@ export default Component.extend({ | |||
classNameBindings: [ 'breadCrumbClass' ], | |||
hasBlock: computed.bool('template').readOnly(), | |||
currentRouteName: computed.readOnly('applicationController.currentRouteName'), |
There was a problem hiding this comment.
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
Thanks! I'll update this and address your notes tonight. |
13b24a8
to
f902b7d
Compare
|
f902b7d
to
adc773c
Compare
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); |
There was a problem hiding this comment.
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?
adc773c
to
447d3ef
Compare
This is rebased with the improvements you noted. Thanks! |
👍 Thanks @gmurphey! Sorry for dropping the ball on this. |
Adding support for changing dynamic segments.
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
, thecurrentRouteName
remainsusers.user
).Unfortunately, the
ApplicationController
only has access tocurrentRouteName
andcurrentPath
; neither of which is aware of dynamic segments. The easiest way to get around this was to injectroute:application
intocomponent:bread-crumbs
, where you can accessapplicationRoute.router.url
, and base crumb computation off changes to theurl
.