Reputation: 15
I have an Angular 1 web-app deployed in which all views(html) are at client side. I have REST APIs exposed at server end which my Angular services uses to get JSON response and then I populate this in my view and render it to UI. Now I plan to render view at sever end.
I can't change my tech stack at client end but I do have freedom of stack at server end.
Blogs are suggesting to use REACT for server side rendering but I am doubtful if we can have server side rendering in REACT and client in Angular. What other alternatives do I have ??
Please do suggest any possible alternatives. Thanks in advance
Upvotes: 1
Views: 968
Reputation: 560
If you were using Angular2 you can get an isomorphic solution like https://github.com/angular/universal
The approach I can see here, and that I have discuss with mates in the past is to "double" the routes on your API. Then you should have a route in which you render an HTML template with, for example, jade and send it to the client. Then, using AngularJS you manipulate the dom as usually and subsequent route changes could be handled by AngularJS router.
So the "algorithm" should be:
Hope it helps!
Upvotes: 0