angular-metas
Dynamic tags setter for AngularJS compatible with default router and ui-router
Install
You can use bower, npm or just download the files from the repository
bower
bower install angular-metas --save
npm
npm install angular-metas
Then, include the module file into your index HTML file
Usage
Configuration
You should define the metas defaults during the config runtime. Just inject the provider and make use of .setDefaults()
method passing an object with the default values
app;
Then synchronize those defaults with your <meta>
tags in <head>
Typically, the number of properties in defaults would be the same as the number of <meta>
tags.
Service Usage
Inject the metas service into your controllers and use .setMetas()
to define the values
app;
In the case above, the author meta will be set with the default value defined through the provider.
Using defaults
Passing null or no argument or empty object or undefined will set defaults.
// All below calls will set default metasmetas;metas;metas;metas;
Full documentation
Check the jsdoc here or create it locally just installing jsdoc and
jsdoc --readme $path-to-readme --package $path-to-packagejson $path-to-cloned-folder
Tests
It uses protractor
Run tests using npm
From inside the angular-metas cloned repository run
npm test
Demo
Check it out working here