Skip to content

Instantly share code, notes, and snippets.

@alexdiliberto
Last active April 21, 2023 08:59
Show Gist options
  • Save alexdiliberto/9948140 to your computer and use it in GitHub Desktop.
Save alexdiliberto/9948140 to your computer and use it in GitHub Desktop.
List all Ember route paths. (Just paste this in the console of your favorite Ember app)
// NOTE: `AppName` is simply your PascalCase application name (`modulePrefix` key from `../config/environment.js`)
window.AppName.__container__.lookup('service:router')._router._routerMicrolib.recognizer.names;
@backspace
Copy link

backspace commented Jul 4, 2019

In Ember 3.4, at least, you can do this, as mentioned here:

router = YourApplicationName.__container__.lookup('service:router');
router._router._routerMicrolib.recognizer.names;

But using the Ember Inspector makes this much easier!

@alexdiliberto
Copy link
Author

@backspace Thanks, yea this is a 5 year old gist...I updated it 👍

@shearichard
Copy link

I can't get my application name to be recognised ... very strange ... anyway expanding on what backspace said here's another approach which steps around that problem (works in Ember Inspector 3.11.0).

  • Use Ember Inspector and select 'Container',

  • select 'route',

  • click on $E at top of Container types list

  • Enter '$E.router._routerMicrolib.recognizer.names;' into console.

@backspace
Copy link

Do you have ember-export-application-global? It’s turned off by default in a production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment