Ember-inspector: accessing currentPath from application controller has been deprecated

Created on 24 May 2019  路  6Comments  路  Source: emberjs/ember-inspector

We tried to access currentPath here and these such access has been deprecated in 3.10. Can we use the router implementation instead ?

bug

Most helpful comment

Ya, the router service only works from 2.15+.

I think the simplest fix is to update:

https://github.com/emberjs/ember-inspector/blob/65409c9ab2084899fb4eb48e222fb6e1f77c048b/ember_debug/route-debug.js#L29

To use namespace.owner.router.currentPath instead. It has been around since 2.1 (added in this commit).

All 6 comments

@gokatz this is in ember_debug code, which needs to support back to Ember 2.7. We may need a conditional that checks the Ember version and uses different logic based on the version. If you wanted to try switching to the other implementation, it is possible it might work. I am away until June 3rd, and won't have a ton of time to look into this until then.

cc @rwjblue @pzuraq

Ya, the router service only works from 2.15+.

I think the simplest fix is to update:

https://github.com/emberjs/ember-inspector/blob/65409c9ab2084899fb4eb48e222fb6e1f77c048b/ember_debug/route-debug.js#L29

To use namespace.owner.router.currentPath instead. It has been around since 2.1 (added in this commit).

That's super fast. Thanks @rwwagner90 and @rwjblue 馃嵕

@gokatz we aim to please 馃槃

Is everything working well for you now?

Yeah. Works perfectly. Thanks again!

Was this page helpful?
0 / 5 - 0 ratings