Angular 2 server rendering with java interface

I am using angular 2 with java content (tomcat). I am trying to implement server side rendering in my POC. I was wondering if angular universal can help me (client side). I apologize in advance, I'm completely new to angular and nodejs.

To understand server side rendering with universal, I look at https://github.com/angular/universal-starter/tree/master and https://github.com/alexpods/angular2-universal-starter .

First of all, I am wondering if the behavior that I observe for this project is normal:

For the first, preboot does not seem to work, (I put the preboot flag in true in main.node.ts): if I type something in the input field, it is deleted when angular loads ...

For the second, I wonder if the server’s rendering really works, because even if I add throttling in my chrome parameters, the load time is long and after that the page appears (as if it had been processed by the client after all the loading assets)

I also have to say that my POC can be naive and simple at the moment, but it’s hard for me to understand the entry points to this project, mine is simple:

html:

<script src="/js/systemjs.config.js"></script> 

systemjs:

 ... var packages = { 'app': { main: 'main.js', defaultExtension: 'js' }, ... 

main.ts (compiled in js)

 bootstrap(AppComponent, [HTTP_PROVIDERS]); 

I might have skipped some nodal tips.

In the end, can anyone explain what exactly are the differences between the rendred server version and the client version of the page?

Thanks a lot!

+5
source share

All Articles