How include SEO in Angular 2 so google can index my site?

321 views
Skip to first unread message

ayman kassas

unread,
Feb 23, 2017, 2:12:36 PM2/23/17
to Angular and AngularJS discussion

we are writing to you asking for your help to know how we can apply google indexing for our angular 2 SPA. we are working on angular 2 on our site and our links like 'http://exammple.com/#/en/logs'.

How we can include SEO in this situation? How we can include meta data according to route? we using MVC & Web Api in backend.

Please Advise.

Sander Elias

unread,
Feb 24, 2017, 1:05:49 AM2/24/17
to Angular and AngularJS discussion
Hi Ayman,

You might want to look up angular-universal. Also, if you need some serious SEO, you might want to deploy a server-side router that prepopulates your routes. 
Oh, and at least, go to html5 routeing (drop the # in your links) as that is a no go on SEO nowadays.

Regards
Sander

ayman kassas

unread,
Feb 24, 2017, 2:50:26 AM2/24/17
to Angular and AngularJS discussion
Thank you Mr.Sander,
should i use asp.net core with angular-universal and it is so complex .
second , there is a problem when i dropped the # , so when refresh the page the URL will rout to MVC , and the angular route is not existed in the MVC routes.
Could you please help me ?

Regards

Sander Elias

unread,
Feb 24, 2017, 7:51:12 AM2/24/17
to Angular and AngularJS discussion
Hi Ayman,

I don't think you need asp.net. Have a look here: https://universal.angular.io/quickstart/
Also, my friend Wassim, did a talk on ngVikings, that might get you going.

Regards
Sander
Reply all
Reply to author
Forward
0 new messages