Comparing version 8.0.0 to 9.0.0
@@ -0,1 +1,11 @@ | ||
## 9.0.0 (2020-05-16) | ||
##### Chores | ||
* update dependencies ([e84a5304](https://github.com/MichaelSolati/ngmeta/commit/e84a530400830438c622759d379a3af20e77808f)) | ||
##### Refactors | ||
* rewrite library and update for angular 9 ([c392efbe](https://github.com/MichaelSolati/ngmeta/commit/c392efbeca56aeb3b97734ea40f02161540ef43d)) | ||
## 8.0.0 (2019-06-27) | ||
@@ -2,0 +12,0 @@ |
{ | ||
"name": "ngmeta", | ||
"version": "8.0.0", | ||
"version": "9.0.0", | ||
"description": "A tool for updating meta tags in an Angular application.", | ||
@@ -28,3 +28,3 @@ "main": "dist/index.js", | ||
"author": "Michael Solati <mkslt04@gmail.com>", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"bugs": { | ||
@@ -43,20 +43,18 @@ "url": "https://github.com/MichaelSolati/ngmeta/issues" | ||
"peerDependencies": { | ||
"@angular/common": "8.x.x", | ||
"@angular/core": "8.x.x", | ||
"@angular/platform-browser": "8.x.x", | ||
"@angular/router": "8.x.x", | ||
"@angular/common": "9.x.x", | ||
"@angular/core": "9.x.x", | ||
"@angular/platform-browser": "9.x.x", | ||
"rxjs": "6.x.x" | ||
}, | ||
"devDependencies": { | ||
"@angular/common": "8.x.x", | ||
"@angular/compiler": "8.x.x", | ||
"@angular/compiler-cli": "8.x.x", | ||
"@angular/core": "8.x.x", | ||
"@angular/platform-browser": "8.x.x", | ||
"@angular/router": "8.x.x", | ||
"generate-changelog": "^1.x.x", | ||
"@angular/common": "9.x.x", | ||
"@angular/compiler": "9.x.x", | ||
"@angular/compiler-cli": "9.x.x", | ||
"generate-changelog": "1.x.x", | ||
"@angular/core": "9.x.x", | ||
"@angular/platform-browser": "9.x.x", | ||
"rxjs": "6.x.x", | ||
"typedoc": "^0.x.x", | ||
"typescript": "~3.4.3" | ||
"typedoc": "0.x.x", | ||
"typescript": "3.6.4" | ||
} | ||
} |
# ngmeta [![Build Status](https://travis-ci.org/MichaelSolati/ngmeta.svg?branch=master)](https://travis-ci.org/MichaelSolati/ngmeta) | ||
A tool for updating meta tags in an Angular application. | ||
* [Getting Started](#getting-started) | ||
* [How To Use](#how-to-use) | ||
* [Documentation](#documentation) | ||
* [Interfaces](#interfaces) | ||
* [Functions](#functions) | ||
* [Changes](#changes) | ||
- [Getting Started](#getting-started) | ||
- [How To Use](#how-to-use) | ||
- [Documentation](#documentation) | ||
- [Interfaces](#interfaces) | ||
- [Functions](#functions) | ||
- [Changes](#changes) | ||
## Getting Started | ||
``` | ||
@@ -17,3 +19,5 @@ npm install --save ngmeta | ||
## How To Use | ||
First import the `NgMetaModule` into your app. | ||
```typescript | ||
@@ -32,3 +36,5 @@ import { NgMetaModule } from 'ngmeta'; | ||
``` | ||
To dynamically edit this data whenever a page is loaded. Import `NgMetaService` into your component, then inside of your constructor pass in the `NgMetaService` service as an argument... | ||
```typescript | ||
@@ -41,16 +47,21 @@ import { NgMetaService } from 'ngmeta'; | ||
``` | ||
Then in the component we can call our `NgMetaService` service `this._ngmeta.setHead()`. This takes an object of the new values for the tags you want. Below we change the title and description data on a page. | ||
Then in the component we can call our `NgMetaService` service `this._ngmeta.setHead()`. This takes an object of the new values for the tags you want. Below we change the title and description data on a page. | ||
```typescript | ||
this._ngmeta.setHead({ | ||
title: 'Google', | ||
meta : [ | ||
{attribute: 'name', type: 'description', content: 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.'} | ||
] | ||
this._ngmeta.setAll({ | ||
title: "Google", | ||
description: | ||
"Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.", | ||
}); | ||
``` | ||
Now our head data will display | ||
```html | ||
<head> | ||
<title>Google</title> | ||
<meta name='description' content='Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.'> | ||
<title>Google</title> | ||
<meta name='description' content='Search the world's information, including | ||
webpages, images, videos and more. Google has many special features to help | ||
you find exactly what you're looking for.'> | ||
</head> | ||
@@ -60,40 +71,7 @@ ``` | ||
## Documentation | ||
Full documentation for the NGMeta service is [available here](https://ngmeta.michaelsolati.com). | ||
## Interfaces | ||
For typing you can take two of ther interfaces that `NgMetaService` uses by importing them with | ||
```typescript | ||
import { TagData, MetaData } from 'ngmeta'; | ||
``` | ||
## Changes | ||
```typescript | ||
interface MetaData { | ||
type: string; | ||
content: string; | ||
attribute?: string; | ||
} | ||
``` | ||
```typescript | ||
interface TagData { | ||
title?: string; | ||
name?: MetaData[]; | ||
property?: MetaData[]; | ||
meta?: MetaData[]; | ||
canonical?: string; | ||
} | ||
``` | ||
## Functions | ||
Function | Description | ||
-------------- |:--------------------------------- | ||
`set canonical(canonicalURL: string)` | Sets canonical tag for page, to call `this._ngmeta.canonical = 'https://www.google.com';`. | ||
`public createMeta(metaData: MetaData)` | Creates HTML for a `<meta>` tag of any attribute. | ||
`get scroll()` | Returns boolean value if scroll to top is enabled, to call `let scroll: boolean = this._ngmeta.scroll;`. | ||
`set scroll(scroll: boolean)` | Sets wether `<body></body>` should scroll to top on route change, to call `this._ngmeta.scroll = true;`. | ||
`public setHead(tagData: TagData)` | Set function setting all `<head></head>` metadata. | ||
`get title()` | Returns string value of current page's title, to call `let title: string = this._ngmeta.title;`. | ||
`set title(title: string)` | Sets `<title></title>` tag for page, to call `this._ngmeta.title = 'Google';`. | ||
## Changes | ||
Changes happen, check out [the changelog](https://github.com/MichaelSolati/ngmeta/blob/master/CHANGELOG.md) to see the latest changes. |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
9
52105
12
1150
74
1