tfMetaTags
Angular module for providing MetaTags support based on routes.
Inspired from angular-metatags and used some ideas from ui-router-metatags.
Versions
When using ui-router 1 or higher, use tf-metatags 2 or higher.
ui-router | tf-metatags |
---|---|
>= 1.0.0 | >= 2.0.0 |
< 1.0.0 | < 2.0.0. |
Installation
Download tf-metatags.min.js and include it on your page
Include it in your module declaration
angular;
Add the tfMetaTags service to your page
Then configure defaults
angular ;
And finally decorate the routes with tfMetaTags:
angular ;
SEO concerns
Until the search engine bots will be able to execute javascript properly you will have to use a tool like prerender.io or brombone to serve prerendered pages when a bot visit your site.
You can read more for the topic on the following articles:
-Weluse.de - Angular & SEO finally a piece of cake
-Builtvisible.com - The Basics of JavaScript Framework SEO in AngularJS
-Yearofmoo.com - AngularJS and SEO
Running sample app & Testing
First you need to install the dependencies
npm install
./node_modules/bower/bin/bower install && ./node_modules/protractor/bin/webdriver-manager update
Now you are able to have the server up and running. Go and start the server
grunt server
Running tests
We have JSHint, JSCS, Unit tests and E2E tests.
All of them can be run once using the following command
grunt test
You can see the coverage on the command line output or more details opening the test/coverage/index.html
file on your browser.
Running JSHint
For running JSHint
grunt test:jshint
Running JSCS
For running JSCS
grunt test:jscs
Running Unit Tests
For running unit tests
grunt test:unit
Running E2E Tests
For running E2E
grunt test:e2e
Building
For create a build run
grunt build
This task will also make sure all tests are passing before making the build, once build is completed it also perform tests against the generated code.