Hi I am developing a widget module in my existing Angular 1 based UI project. This widget is supposed to contain real time information.
As per my design, I want to send html view to client from node server(maybe using express js) when the first request is made. But as the data needs to be real time, I cant afford to send the complete html every minute(will be duplicate template transfer each time).
So is it possible that I send a template to client along with a set of java-script functions so that when ever client wants that data to be refreshed, he will just invoke the sent javascript function and internally my javascript function will make a rest call, get the json response from server and again repopulate the html sent initially.
This way I am planning to have initial rendering at server side and subsequent rendering at client using the logic provided by server. Here client will not be aware of which widget it is rendering and what functionalities it has. All those will be controlled by js sent from server.
Please do let me know how to achieve this as I find ejs not serving this purpose. With ejs, I need to have all logic to server side only. Whereas I plan to transfer logic from server to client at run time.
Also if my design is having some serious problems, do suggest some other alternatives. Thanks