Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server side rendering with Angular cli

I just want to know if is possible to run Angular2 cli with server rendering similar to Angular2 universal?

The problem is that the crawler can not read the sites with Angular2 cli and this is important for SEO.

Is it possible to add easily angular universal into angular cli or it is from conf different?

like image 833
Tony Avatar asked Nov 09 '22 02:11

Tony


1 Answers

Angular-cli can now compile your ng generated code into universal code.

The full how-to guide on how to prepare your angular 2 code for a universal build can be found here

As for SEO, Angular 4 has a built in Meta service that is imported from the platform-browser module. If you're looking for a meta service for angular 2, you can try using ng2-meta to insert meta tags for SEO.

Great news for us devs that have an angular-cli generated project!

like image 195
Kim Merino Avatar answered Nov 15 '22 07:11

Kim Merino