-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular Universal support #1
Comments
hi @vforv. thanks for checking on this. sure, you can use this with Angular Universal. we have Angular Universal seed prepared too here. |
Got error on webpack seed:
Could you make exaple angular-closure-compiler + server side rendering? |
I believe its just a issue with paths to |
Tried, same error....
Could you help me to integrate universal in angular-closure-compiler? |
guess you are doing something wrong, tried here with fresh clone, my steps: git clone https:/bleenco/angular-webpack-seed.git
cd angular-webpack-seed
npm install
npm run build:prod
node dist/server.js and it works for me. you mean compiling universal server side code with closure-compiler? |
Yes that would be great if that possible... Currently all repos that I tried creates big bundle 350KB+... Just closure compiler makes it below 100KB... |
you still don't need to compile server side code with closure, only client side code (browser).
I believe that is what you want to achieve. |
I will try it tomorrow but not sure it will render staff from client side... |
I am not sure you understand difference between server side and client side compiling. |
i don't understand fully how Angular Universal works... I know in universal cli I can write code for client and server side... But here if I just write code on client side I will get all content rendered in browser? |
server side code only works for rendering html before loading angular in the browser, that's why you run express server which bootstraps angular on the server side, generate html and serves that html to the browser. once browser initializes the application (client side) the whole html between the size of server-side generated code does not effect loading application in the browser, but client-side generated code does. so;
please check again this steps and everything should be working as you want:
hope I explained some things that was unclear at the beginning. cheers, Jan |
Thanks for clarification, but still one thing not clear to me... How server know which code to render and get html from it? I tried steps you provided now angular webpack seed works, but have problem when I try to merge bundle.js from this repo with webpack seed server... Text from this repo "app works!" not showing and when I change route page refresh(see loading indicator from browser tab). |
server renders route that you provide in the browser. yeah, I don't doesn't work right off, but if you make angular webpack seed just a simple |
Aha, but I will need in my apps routing, http and other staffs... Could you provide me steps how to make this work together? |
This is good, any disadvantages using this compiler? Also how can I implement Angular Universal to this?
Thanks
The text was updated successfully, but these errors were encountered: