addon/initializers/route-alias.js
function createAlias() {
  Ember.RouterDSL.prototype.alias = function(aliasRoute, aliasPath, aliasTarget) {
    Ember.assert('You must create a route prior to creating an alias.', this.handlers || this.intercepting);
    Ember.assert('The alias target must exist before attempting to alias it.', this.handlers[aliasTarget]);

    // Grab a reference to the arguments passed in for the original route.
    let [options, callback] = this.handlers[aliasTarget];
    options.path = aliasPath;

    this.intercepting.push({ aliasRoute, aliasTarget });

    this.route(aliasRoute, options, callback);
  };
}
function createAlias() {
  Ember.RouterDSL.prototype.alias = function(aliasRoute, aliasPath, aliasTarget) {
    Ember.assert('You must create a route prior to creating an alias.', this.handlers || this.intercepting);
    Ember.assert('The alias target must exist before attempting to alias it.', this.handlers[aliasTarget]);

    // Grab a reference to the arguments passed in for the original route.
    let [options, callback] = this.handlers[aliasTarget];
    options.path = aliasPath;

    this.intercepting.push({ aliasRoute, aliasTarget });

    this.route(aliasRoute, options, callback);
  };
}
function createAlias ( ) { Ember . RouterDSL . prototype . alias = function ( aliasRoute , aliasPath , aliasTarget ) { Ember . assert ( 'You must create a route prior to creating an alias.' , this . handlers || this . intercepting ) ; Ember . assert ( 'The alias target must exist before attempting to alias it.' , this . handlers [ aliasTarget ] ) ; // Grab a reference to the arguments passed in for the original route. let [ options , callback ] = this . handlers [ aliasTarget ] ; options . path = aliasPath ; this . intercepting . push ( { aliasRoute , aliasTarget } ) ; this . route ( aliasRoute , options , callback ) ; } ; }
Sets up our magic alias function.
Sets up our magic alias function .