Good, DRY practice for mapping properties to routes


#1

I’m trying to understand the best practice for mapping properties for my routes in a DRY, configurable pattern. What I’d really like to do is create a mapping between my routes and their respective properties (eg, display name)

So given:

App.Router.map(function () {
  this.resource('index', { path: '/', displayName: 'Application Home' });
  this.resource('about', { path: '/about', displayName: 'About This App' });
});

I’d like a way to access the Router map to find the displayName for a given route.

What I’m doing now is creating a navigation controller, using needs: ['application'], and manually creating a map of routes to display names (thus duplicating route names in the code). This seems like a poor way to maintain the application.

I’m a newbie, maybe I’m overlooking the obvious?