1

I need to know name of current Route in Ember from controller.after searching i find this topic and this topic but this.routeName and this.get('currentPath') dosent work for me.my Ember version is 1.1.2

Community
  • 1
  • 1
MBehtemam
  • 7,865
  • 15
  • 66
  • 108

1 Answers1

4

The only way i know how to do this is to require application controller like this.

App.AfterController = Ember.Controller.extend({
  needs: ['application'],
  init: function() {
    alert('Current route is ' + this.get('controllers.application.currentPath'));
    this._super();
  }
});
iConnor
  • 19,997
  • 14
  • 62
  • 97