# ngx-window-token

> angular window inject token

Latest version **7.0.0** (published 2023-04-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-window-token
pnpm add ngx-window-token
yarn add ngx-window-token
bun add ngx-window-token
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 7.0.0 |
| Published | 2023-04-10 |
| First published | 2017-05-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^14.20.0 \|\| ^16.13.0 \|\| >=18.10.0 |
| Dependencies | 1 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Author | Sam Lin |
| Maintainers | maxisam |
| Keywords | angular, window, inject, token |

## Links

- npm: https://www.npmjs.com/package/ngx-window-token
- Repository: https://github.com/maxisam/ngx-window-token
- Issues: https://github.com/maxisam/ngx-window-token/issues
- npm.io page: https://npm.io/package/ngx-window-token

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.0.0

## Recent versions

- 7.0.0 (latest) — 2023-04-10
- 7.0.0-beta02 (next) — 2023-04-11
- 7.0.0-beta01 — 2023-04-11
- 6.0.0 — 2021-11-14
- 6.0.0-beta01 — 2021-11-14
- 5.0.0 — 2021-04-01
- 5.0.0-beta01 — 2021-03-31
- 4.0.0 — 2020-10-19
- 4.0.0-beta01 — 2020-07-19
- 3.0.0 — 2020-02-21
- 3.0.0-beta01 — 2020-02-13
- 2.0.1 — 2019-03-05
- 2.0.0 — 2019-03-04
- 2.0.0-beta.1 — 2018-10-19
- 1.0.2 — 2018-10-11
- … 7 more at https://npm.io/package/ngx-window-token/versions

## README

[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/)
[![ngx-window-token](https://github.com/maxisam/ngx-window-token/actions/workflows/ngx-window-token.yml/badge.svg)](https://github.com/maxisam/ngx-window-token/actions/workflows/ngx-window-token.yml)
[![npm](https://img.shields.io/npm/dt/ngx-window-token.svg?style=flat-square)](https://www.npmjs.com/package/ngx-window-token)
[![GitHub release](https://img.shields.io/github/release/maxisam/ngx-window-token.svg?style=flat-square)](https://github.com/maxisam/ngx-window-token/releases)
[![npm](https://img.shields.io/npm/l/ngx-window-token.svg?style=flat-square)]()

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.

# ngx-window-token

It is the same way how angular handle document. With this module, you can use WINDOW token just like DOCUMENT token.

# Breaking Change after version 7.0.0

BREAKING CHANGE: Support Angular >= 15 only

# Breaking Change after version 6.0.0

BREAKING CHANGE: Support Angular >= 13 only

# Breaking Change after version 5.0.0

return undefine if window is undefine. Before, it doesn't even inject WindowToken.

# Breaking Change after version 1.0.2

removed now-unnecessary `NgxWindowTokenModule`, it will be inject into root module

# Breaking Change after version 1.0.0

change `WindowTokenModule` -> `NgxWindowTokenModule`

## Dependencies

- Angular >=6.0.0

## Install

You can get it on npm.

```
npm install ngx-window-token --save
```

## Build project

```
1. npm i

2. npm run build
```

## Usage

If you use SystemJS to load your files, you might have to update your config:

```js
System.config({
  map: {
    'ngx-window-token': 'node_modules/ngx-window-token'
  }
});
```

In your component

```
  constructor(@Inject(WINDOW) _window) { }
```

For webpack / Angular CLI, it works as any other libraries. Please check demo folder for more help.

## Example

[stackblitz.com](https://stackblitz.com/github/maxisam/ngx-window-token)

or clone this repo and run `ng serve`

## Contributing

1. Your commits conform to the conventions established [here](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md)

---
_Source: https://npm.io/package/ngx-window-token · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
