Get current path with dynamic segment in ember.js

I was wondering how can I get the current Path in Ember with a dynamic element? I know that there is

@get('currentPath') 

in applicationController, but that will only give me "user.show", and I would also like to get a path like "/ users / 1". I know I can do this with window.location.href, but is there any other way ("Ember")?

Relationship Peter

+7
source share
1 answer

I'm not sure if this applies to the Ember Way method, since it is not listed in the documents, but the controller target contains both a link to document.location and a property called lastSetURL .

 this.get('target').location.lastSetURL; // "/foo/1" 
0
source

All Articles