1

I'm currently building my first Ember app and I'm using Ember.Router to fetch parameters from the URL, set up the correct state and connect a couple (5) of outlets.

What bugs me is that when a single parameter in the URL changes, the Router log shows me that the app completely re-routes and re-instantiates all the views (messing up transitions etc.)..

Example:

GET /#/myapp/from/2012-01-01/to/2012-12-31

Log output:

STATEMANAGER: Entering root ember.js:18 
STATEMANAGER: Sending event 'navigateAway' to state root. ember.js:18 
STATEMANAGER: Sending event 'unroutePath' to state root. ember.js:18 
STATEMANAGER: Sending event 'routePath' to state root. ember.js:18 
STATEMANAGER: Entering root.main ember.js:18 
STATEMANAGER: Entering root.main.range ember.js:18
STATEMANAGER: Entering root.main.range.index ember.js:18

Then I change the hash (so no new request)

/#/myapp/from/2012-06-01/to/2012-12-31

Log output:

STATEMANAGER: Sending event 'navigateAway' to state root.main.range.index. ember.js:18
STATEMANAGER: Sending event 'unroutePath' to state root.main.range.index. ember.js:18
STATEMANAGER: Sending event 'unroutePath' to state root.main.range. ember.js:18
STATEMANAGER: Sending event 'unroutePath' to state root.main. ember.js:18
STATEMANAGER: Sending event 'unroutePath' to state root. ember.js:18
STATEMANAGER: Sending event 'routePath' to state root. ember.js:18
STATEMANAGER: Entering root.main ember.js:18
STATEMANAGER: Entering root.main.range ember.js:18
STATEMANAGER: Entering root.main.range.index ember.js:18

Am I missing something here, because this looks a little redundant. And not only that, I've got a beautifully transitioning chart in my app which now completely reloads everytime a user presses back or forward in their browser..

sly7_7
  • 11,961
  • 3
  • 40
  • 54
joostdevries
  • 930
  • 1
  • 6
  • 13

0 Answers0