title: How would I get a list of all the routes of my application in Ember.js 3.18?
body: <p>I am trying to build an automatic navigation.</p>
  
  <p>How would I get a list of all the routes of my application in Ember.js 3.18?</p>
  
  <p>This question was asked 4 years ago and the answers seem outdated and hack-ish.</p>
  
  <p>I have been trying several things. This kind of code gets me the current route name. But that's not what I want: I want an object of all the available routes.</p>
  
  <p>In component JS:</p>
  
  <pre><code>import { inject as service } from '@ember/service';
  
  export default class navComponent extends Component {
    @service router;
  }
  </code></pre>
  
  <p>In template:</p>
  
  <p><code>{{router.currentRouteName}}</code></p>