Struggling to get my head around this functionality.
I use a sails server view to host a simple find for a given model in the DB. When browsing to: url/model I get the html view that populates the data. So far so good.
My view is handled by angular and have databinding between the visible data and what came from the server (ejs).
Now, I want the data to change dynamically with sockets on the client view.
Reading the code and the docs, it seems I need to have the client view, actually get the data to be able to subscribe to it on the server side. (This handled in blueprints, or manually if I want to in a controller method).
The problem is that I will be querying the data twice in the DB. Once in the server hosted view with the default HTTP handled blueprint, and then Twice when I actually have to get the data via sockets.
I managed to only do this once, if my client is standalone, by simply querying the data via sockets only.
But how can I do both ? Server hosted views and data, with subscription to sockets for updates, without having to get the data twice ?
Thx.
Aucun commentaire:
Enregistrer un commentaire