I
I
Isaac Clark2018-04-11 11:29:39
Angular
Isaac Clark, 2018-04-11 11:29:39

What should be rendered on the server when developing with Angular?

Hello
Please tell me, when developing a SPA application in Angular, what should be rendered on the server? Please tell me why server rendering is needed at all and in what cases is it used?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aleksei Podgaev, 2018-04-19
@alexiusp

Answer No. 1: everything that is possible to display the initial (or some intermediate) state of the application.
Answer #2: In most of the uses I've seen, server rendering is needed to speed up the loading of the initial state of the application. In the usual approach, a blank screen (or loading indicator) is shown to the user until the browser downloads all scripts and templates, launches Angular, and Angular in turn parses the templates and launches the controller of the desired component. With slow or bad internet (for example, somewhere on the road) or on a weak device, this can take quite a long time. When using server rendering, the user receives a finished page from the server with a fully rendered initial state. Those. he can already start reading some information, scrolling or something else, without waiting for the full load of angular.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question