I need to get current url from Ember as a "redirectTo" parameter. The parameter will be used to redirect users back to the same page after they login from other app. The url looks like
http://test.com/apps/#/tables/7
I've found this post to get currentPath/route from the application. It provides the current route name but I wonder how I can get the complete path including id from Ember. I have a nested route declaration looks like below.
App.Router.map(function() {
this.resource('tables', function() {
this.resource('table', { path: ':table_id' });
});
});
Any suggestion is welcome. Thanks!
Observe the currentPath in ApplicationController and update the current URL:
App.ApplicationController = Ember.Controller.extend({
currentPathDidChange: function() {
App.currentUrl = window.location.href;
}.observes('currentPath')
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With