1

I have currently an Angular 2 application, to build that application was used a template that my boss bought. Now, I was checking about Angular Universal and we would like to use it in our project to have server side rendering, I was reading but I find not the answer for these questions:

  1. Can I make the current project to use angular universal? or is intended to adapt everything?
  2. From Angular Universal how the state is managed? if I have redux, will this be a problem?
  3. The calls to external apis, using HTTP are normal? or it's only for backends developed in Node? because we have a backend built in Golang

1 Answer 1

1
  1. You can integrate it to existing application, but I guess you will probably need to update your project first to latest angular (4.4) or something like that, to be able to use it.

  2. State management is the same, there is just one thing that you will need to handle, which is state transfer between server rendered version and browser. Universal first renders the page on server side, returns compiled code, which is displayed to user, and after that it is again rehydrated in the browser, so without this state transfer, you will make all API calls twice. This this is being integrated to next angular/universal (5).

  3. No problem at all, working with HTTP requests is the same. Again, you should handle the transition of those request responses from server to browser, otherwise you will make all requests twice.

Take a look at this seed project, it helped me a lot with bootstrapping my universal project:

https://github.com/angular/universal-starter

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.