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,429
  • 13
  • 59
  • 102

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,491
  • 13
  • 60
  • 93