0
votes

I have a basic ember question here. I'm looking to set up an ember ApplicationRoute that gets loaded immediately, and have all other routes extend from this application route. I would like the data that the ApplicationRoute loads to be loaded on every page transition. Is this possible? FYI I'm also using ember-data and rails as an API.

Thanks!

1
So the behavior you need is to load something with each request? Just curious why you would need this to run on each route - Toran Billups
Im trying to implement a messaging/notification system of sorts. Ember doesnt seem to have a solid solution yet for real time data loading. I've been back and forth between using a websockets approach and loading the data with each transition. - Bobby Hazel
ah, I can't say I've done anything with real-time myself but you could always implement long polling at some layer in the stack (in which case you "could" just fire an async $.ajax in the application route (as it should fire with each navigation). I can't say if this is the right or wrong way to do it, but it should work well enough to spike it out - Toran Billups

1 Answers

0
votes

If you want a real time data pushed from a server you should try extending your ApplicationAdapter to handle data from websocket connection and push in to the store object. A nice example of parsing model data from websocket connection may be found in API docs http://emberjs.com/api/data/classes/DS.RESTSerializer.html#method_extract