2013-08-02 5 views
5

Sto cercando di reindirizzare /cruscotto/ a /cruscotto/raggiungere/demografiche Se l'URL colpisce /cruscotto/.Emberjs redirect solo percorso di default se non viene specificato sottopercorso

Il problema è che continuo a reindirizzare su /dashboard/reach/demographic/ se prendo un sottotitolo come **/dashboard/traffico.

Qual è il modo Ember di farlo?

Ecco il mio codice:

(function() { 
    App.Router.map(function(match) { 
     this.resource('dashboard', function() { 
     this.resource('traffic', function() { 
      this.route('visits'); 
      this.route('pageviews'); 
      return this.route('duration'); 
     }); 
     return this.resource('reach', function() { 
      this.route('demographics'); 
      this.route('over_time'); 
      return this.route('devices'); 
     }); 
     }); 
     return this.route('audience'); 
    }); 

    App.DashboardRoute = Ember.Route.extend({ 
     redirect: function() { 
     return this.transitionTo('reach.demographics'); 
     } 
    }); 

    if (!App.ie()) { 
     App.Router.reopen({ 
     location: 'history' 
     }); 
    } 

    App.reopen({ 
     rootUrl: '/' 
    }); 

    }).call(this); 

risposta

Problemi correlati