(no title)
conorgdaly | 5 years ago
Your server can just return html which is ready to be inserted into DOM. You don't need to duplicate the node view creation logic client side.
conorgdaly | 5 years ago
Your server can just return html which is ready to be inserted into DOM. You don't need to duplicate the node view creation logic client side.
postpawl|5 years ago
conorgdaly|5 years ago
There seems to be some confusion. With your list example, you still make an ajax call to create a new ToDo, the server returns html which is inserted into DOM.
You'll be making an ajax call anyway, except instead of just 200 reponse/json , you'll get html. This is server side rendered. There is no """hidden “ready to be inserted into the DOM” elements"""
Yes, forms are something which, depending on complexity, can be better served with SPA type solution.
If it's not complex, I'd still keep rendering server side and just add small bit of JS logic to update form header to add/remove to error list and just replace form input field with server response.