Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4837

Using global state across multiple routes

$
0
0

@joshhornby wrote:

I am building an ember app which needs to keep some dates in its 'global' state, these dates will be set by a date picker. The date picker can be used on multiple routes if I select a date on /departments then when I navigate to users/2 the same date should be applied.

Selecting the date from the date picker should also trigger query params to update some ember-data models and fetch new data, the same for if I navigate pages, the data fetched should include the query params of the global state attached to the request.

Please see this wireframe for a simple example of the above: https://wireframe.cc/2iwb7j

What is the correct way to achieve this? Should I on change of the date picker send out an action and handle that in the controller for each page, this controller then sets the values on a service? Thus acting as global state, or is there a better ember way?

Thanks

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4837

Trending Articles