2013-08-02 10 views
5

próbuję przekierować /deska rozdzielcza/ do /deska rozdzielcza/zasięg/demograficzna jeśli url uderza /deska rozdzielcza/.Emberjs tylko przekierować do domyślnej trasy jeśli nie subroute podano

Problem polega na tym, że nadal dostaję przekierowanie na numer /dashboard/reach/demographic/, gdy uderzę w subroute typu **/dashboard/traffic.

Jaki jest sposób Ember tego?

Oto mój kod:

(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); 

Odpowiedz

Powiązane problemy