How to use Google Ajax crawl with Angular

Google supports a scheme in which you can indicate that the page has dynamic content, this requires the fragment URL to start with !, for example, dynamic.html #! part

Angularjs has very good routing support, but it seems to require the fragment to always start with the / character. Does anyone know a way for these fragments to start with ??

http://support.google.com/webmasters/bin/answer.py?hl=en&answer=174992

+4
source share
2 answers

I'm just starting out with Angular myself, but I think you want to install the $location hashPrefix service.

See the developer guide at $ location service .

As you can see from the example, you would do something line by line:

 // Not 100% sure this is right $locationProvider.hashPrefix('!'); 

There is also a more automated way to do this, described in the “Crawl your application” section near the bottom of the same documentation page.

+5
source

If you use a ruby ​​application, there is a stone that implements a workaround for any source code of the gem install google_ajax_crawler application at https://github.com/benkitzelman/google-ajax-crawler

0
source

All Articles