{"_id":"@alibrate/angular-update-meta","_rev":"1-0ee8caea7e487866c2e6eda6b4e668ab","name":"@alibrate/angular-update-meta","dist-tags":{"latest":"2.1.0"},"versions":{"2.1.0":{"name":"@alibrate/angular-update-meta","version":"2.1.0","main":"dist/update-meta.js","author":{"name":"Jurgen Van de Moere","email":"jurgen.van.de.moere@gmail.com"},"scripts":{"test":"gulp test-dist-minified"},"dependencies":{},"devDependencies":{"chai":"^1.9.1","chai-jquery":"^1.2.3","gulp":"^3.8.7","gulp-concat":"^2.3.4","gulp-rename":"^1.2.0","gulp-uglify":"^0.3.1","karma":"^0.12.22","karma-chai":"^0.1.0","karma-chai-jquery":"^1.0.0","karma-chrome-launcher":"^0.1.4","karma-jasmine":"^0.1.5","karma-jquery":"^0.1.0","karma-mocha":"^0.1.8","karma-phantomjs-launcher":"^1.0.2","karma-sinon-chai":"^0.2.0","mocha":"^1.21.4","sinon":"^1.10.3","sinon-chai":"^2.5.0"},"engines":{"node":">=0.8.0"},"description":"Dynamically update meta tags and document title for SEO purposes in your AngularJS application.","directories":{"example":"examples","test":"test"},"repository":{"type":"git","url":"git+https://github.com/Alibrate/angular-update-meta.git"},"license":"ISC","bugs":{"url":"https://github.com/Alibrate/angular-update-meta/issues"},"homepage":"https://github.com/Alibrate/angular-update-meta#readme","gitHead":"1159a4956ae49486e6d5660f2bdc5a573b00c8e5","_id":"@alibrate/angular-update-meta@2.1.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alibrate-npm","email":"oscar.lopez@alibrate.com"},"dist":{"integrity":"sha512-rASy0+acFPcb/es2K/6f5iLa2+2J6pa+y76ajgN3ICsuetrabaaLIc+6dznPqt4ptONJnrgBV7MZyb7bodw0ew==","shasum":"83573a9dcd3301fe99af923933c4111bfdbce5c4","tarball":"https://registry.npmjs.org/@alibrate/angular-update-meta/-/angular-update-meta-2.1.0.tgz","fileCount":26,"unpackedSize":42206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUxQCCRA9TVsSAnZWagAACqoP/0/BX/2F6z2yyEwgjFLN\nSjLoyXTQfhz9sE0o9LEuvydotxvR2ofZN1AKmHIizDjuBgq8O0/uPN7XSHrn\nO0otT1xTInesaNIbWsd7YYAZ/ipqVXDltCODj5AvfVs/t6qt9WHll1hFlVt+\nNaaUUArSWSwNGvzGX7UH8/UB4Koq7bpC015wCGIwDLG2gmBzzDRwlo663ubE\ndg1TIKUNoUBaANN2aw3f1Sr+i/uFYCsZD8MfpeWJP34l2JSYJKMily6Uy9nE\nDHWst+ynsECcrToYCiNdoVCWfDFOUXziXsiEQy4RjTmPgkSvLPIbv7i3Qt2S\nx7m4R3galgncXZcsHz7ano5CGOIp2hxT5+gGRXcNz6jaWkoe6Bzibqcd0id3\nVhjJH5X+8GV7xMvPi2DPNt2JhnGyVm+q3YBYgbX5DoGtzk18TG0oJ1vgFB7j\nUYfXq903Loy9JUO9xXStnCVUWEYFiiq8LOvs2N9QkPgYv/I7bpSiLlcgFSbs\nMlYRvuE2s1SY2Zbl6HCAwE7O2BSWEpyR/gNvlVKW/eZGTo94qG5CRXarQmrU\nRKq7CKL+2iWzLhRg+Dp9FDhtEPBVSDVcBi3jrsb7M9X0qJ0f1QbBASpSEhk1\nxqhWJV97Ht0IAx07AnnuN5QMpjgxwznhl5EBwsdPP/WmHk54oo8VtUmMLigs\nXuUB\r\n=7v+C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC+xj3GxusGgBrXzxEIMxNJDZkuOSeIWn6lM3TGr5Dc4AiEAnWjNkxnd38oZpqkMmp2yMlP1zS2kPjeLeuvh/IjE+Cs="}]},"maintainers":[{"name":"alibrate-npm","email":"oscar.lopez@alibrate.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/angular-update-meta_2.1.0_1548948481536_0.8746463640707314"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-31T15:28:01.536Z","2.1.0":"2019-01-31T15:28:01.624Z","modified":"2022-04-04T12:53:42.943Z"},"maintainers":[{"name":"alibrate-npm","email":"oscar.lopez@alibrate.com"}],"description":"Dynamically update meta tags and document title for SEO purposes in your AngularJS application.","homepage":"https://github.com/Alibrate/angular-update-meta#readme","repository":{"type":"git","url":"git+https://github.com/Alibrate/angular-update-meta.git"},"author":{"name":"Jurgen Van de Moere","email":"jurgen.van.de.moere@gmail.com"},"bugs":{"url":"https://github.com/Alibrate/angular-update-meta/issues"},"license":"ISC","readme":"# Update meta tags in AngularJS\n\nDynamically update meta tags and document title for SEO purposes in your AngularJS application.\n\n[![Build Status](https://travis-ci.org/jvandemo/angular-update-meta.svg?branch=master)](https://travis-ci.org/jvandemo/angular-update-meta)\n\n- lightweight (< 1KB)\n- uses original meta syntax\n- supports prerender.io for SEO purposes\n- supports [Open Graph protocol](http://ogp.me/) meta elements\n- supports [schema.org protocol](http://schema.org/) meta elements\n- supports link elements\n- update your document title dynamically\n- update your meta tags depending on the state your application is in\n- no additional scripting required, works out-of-the-box!\n\nView [example plunk right here](http://plnkr.co/edit/YgvUohn0zUZUOSroPyWk?p=preview).\n\n## Usage\n\nFirst install the module using bower:\n\n```bash\n$ bower install angular-update-meta\n```\n\nthen add the `updateMeta` module to the dependencies of your AngularJS application module:\n\n```javascript\nangular.module('yourApp', ['updateMeta']);\n```\n\nSuppose you have the following markup in your template:\n\n```xml\n<html>\n  <head>\n    <title>Website title</title>\n    <meta charset=\"utf-8\" />\n    <meta http-equiv=\"Content-Language\" content=\"en\" />\n    <meta name=\"description\" content=\"Application wide description\" />\n    <meta property=\"og:title\" content=\"The Rock\" />\n    <meta itemprop=\"description\" content=\"Application wide description for Schema.org (Google+ uses this)\">\n    <script type=\"application/ld+json\"></script>\n  </head>\n  <body ng-app=\"yourApp\">\n    ...\n  </body>\n</html>\n```\n\nNow you can use the following markup in your view(s):\n\n```xml\n<update-title title=\"A new title\"></update-title>\n<update-meta charset=\"ISO-8859-1\"></update-meta>\n<update-meta http-equiv=\"Content-Language\" content=\"es\"></update-meta>\n<update-meta name=\"description\" content=\"A page specific description\"></update-meta>\n<update-meta property=\"og:title\" content=\"Minions\"></update-meta>\n<update-meta itemprop=\"description\" content=\"A page specific itemprop description\"></update-meta>\n<update-script content=\"structuredData\" type=\"application/ld+json\"></update-script>\n```\nAnd if you want to use [Google Structured Data](https://developers.google.com/search/docs/guides/intro-structured-data), create an object like this in $scope:\n\n```javascript\n$scope.structuredData = {\n  \"@context\": \"http://schema.org\",\n  \"@type\": \"Organization\",\n  \"url\": \"http://www.example.com\",\n  \"name\": \"Unlimited Ball Bearings Corp.\",\n  \"contactPoint\": {\n    \"@type\": \"ContactPoint\",\n    \"telephone\": \"+1-401-555-1212\",\n    \"contactType\": \"Customer service\"\n  }\n};\n```\nSo the head is updated to:\n\n```xml\n<html>\n  <head>\n    <title>A new title</title>\n    <meta charset=\"ISO-8859-1\" />\n    <meta http-equiv=\"Content-Language\" content=\"es\" />\n    <meta name=\"description\" content=\"A page specific description\" />\n    <meta property=\"og:title\" content=\"Minions\" />\n    <meta itemprop=\"description\" content=\"A page specific itemprop description\">\n    <script type=\"application/ld+json\">\n    {\n      \"@context\": \"http://schema.org\",\n      \"@type\": \"Organization\",\n      \"url\": \"http://www.example.com\",\n      \"name\": \"Unlimited Ball Bearings Corp.\",\n      \"contactPoint\": {\n        \"@type\": \"ContactPoint\",\n        \"telephone\": \"+1-401-555-1212\",\n        \"contactType\": \"Customer service\"\n      }\n    }\n    </script>\n  </head>\n  <body ng-app=\"yourApp\">\n    ...\n  </body>\n</html>\n```\n\nOnly **existing** meta elements are updated.\n\nIf the meta element does not exist yet, it is **NOT** added, so make sure they exist in your original `head` element.\n\nWhenever an `update-meta` element is processed, the original `meta` in the head is updated with the new value.\n\nThis allows you to dynamically set the `meta` element values with values from within your markup and child states.\n\nYou can also update link tags. If you have the following markup in your layout:\n\n```xml\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"http://example.com\" />\n    <link rel=\"alternate\" href=\"http://example.com/another\" hreflang=\"\" />\n    <link rel=\"alternate\" href=\"http://example.com/another\" id=\"test\" />\n  </head>\n</html>\n```\n\nand you have the following markup in your view:\n\n```xml\n<update-link rel=\"stylesheet\" href=\"http://example.com/updated\"></update-link>\n<update-link rel=\"alternate\" href=\"http://example.com/another\" hreflang=\"es\"></update-link>\n<update-link rel=\"alternate\" href=\"http://example.com/another-updated\" id=\"test\"></update-link>\n```\n\nthen the head will be updated to:\n\n```xml\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"http://example.com/updated\" />\n    <link rel=\"alternate\" href=\"http://example.com/another\" hreflang=\"es\" />\n    <link rel=\"alternate\" href=\"http://example.com/another-updated\" id=\"test\" />\n  </head>\n</html>\n```\n\nA `rel` and a `href` attribute must be supplied to the directive. The directive will try querying the DOM using the `rel` and `href` attributes, and optionally an `id`. Any of the supported attributes (`id`, `charset`, `crossorigin`, `hreflang`, `integrity`, `media`, `methods`, `referrerpolicy`, `sizes`, `target`, `title`, `type`) will be updated.\n\n### Expressions\n\nDynamic AngularJS expressions are supported too:\n\n```xml\n<update-meta property=\"og:title\" content=\"{{ title }}\"></update-meta>\n```\n\nIn the example above, the `og:title` is automatically updated whenever `title` changes.\n\n### Prerender.io\n\nPrerender.io will grab the updated values and store them in your page snapshots so they are optimized for SEO purposes.\n\nThis allows you to conveniently update the `meta` elements for each individual page in your AngularJS single page application and store them correctly in your Prerender page snapshots.\n\nYou can preview the prerender output by using the `_escaped_fragment_=` parameter as described [in the prerender.io documentation](https://prerender.io/documentation).\n\n## Contribute\n\nTo update the build in the `dist` directory:\n\n```bash\n$ gulp\n```\n\nTo run the unit tests (for both concatenated and minified version):\n\n```bash\n$ gulp test\n```\n\n## Change log\n\n### 2.1.0\n\n- added support for Google Structured Data (credits to [Mostafa Shaheydari](https://github.com/Pymossy))\n\n### 2.0.1\n\n- fix issue with link [#28](https://github.com/jvandemo/angular-update-meta/issues/28) (credits to [Kohei Hisakuni](https://github.com/khisakuni))\n\n### 2.0.0\n\n- added support for link elements [#18](https://github.com/jvandemo/angular-update-meta/pull/18)\n\n### 1.9.0\n\n- added support for itemprop (thank you @urbgimtam)\n- added examples for itemprop\n\n### 1.8.0\n\n- added examples for use with ngRoute and ui-router\n\n### v1.7.1\n\n- fixed bower dependencies\n\n### v1.7.0\n\n- added update-title directive\n- updated documentation\n- updated example\n\n### v1.6.0\n\n- added dynamic tag support\n- updated documentation\n- updated example\n\n### v1.5.1\n\n- fixed issue with `http-equiv`\n- updated documentation\n- updated example\n\n### v1.5.0\n\n- added support for meta `property` elements to support the [Open Graph protocol](http://ogp.me/)\n\n### v1.4.0\n\n- switch to native `element.querySelector()` method to fix #4\n\n### v1.3.0\n\n- added double quotes to support #2\n\n### v1.2.1\n\n- fix bower ignore files\n\n### v1.2.0\n\n- update bower ignore files\n\n### v1.1.0\n\n- add travis support\n- update documentation\n\n### v1.0.0\n\n- refactor to support original markup\n- add unit tests\n- update documentation\n\n### v0.1.0\n\n- Initial version\n","readmeFilename":"README.md"}