Socket
Socket
Sign inDemoInstall

ngx-window-token

Package Overview
Dependencies
5
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ngx-window-token

angular window inject token


Version published
Weekly downloads
137K
decreased by-5.21%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Commitizen friendly ngx-window-token npm GitHub release npm

This project was generated with 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:

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

or clone this repo and run ng serve

Contributing

  1. Your commits conform to the conventions established here

Keywords

FAQs

Last updated on 10 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc