New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ngx-window-token

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-window-token - npm Package Compare versions

Comparing version

to
5.0.0-beta01

26

bundles/ngx-window-token.umd.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
typeof define === 'function' && define.amd ? define('ngx-window-token', ['exports', '@angular/core'], factory) :
(global = global || self, factory(global['ngx-window-token'] = {}, global.ng.core));
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
typeof define === 'function' && define.amd ? define('ngx-window-token', ['exports', '@angular/core'], factory) :
(global = global || self, factory(global['ngx-window-token'] = {}, global.ng.core));
}(this, (function (exports, core) { 'use strict';
var WINDOW = new core.InjectionToken('WindowToken', typeof window !== 'undefined' && window.document ? { providedIn: 'root', factory: function () { return window; } } : undefined);
var WINDOW = new core.InjectionToken('WindowToken', typeof window !== 'undefined' && window.document
? { providedIn: 'root', factory: function () { return window; } }
: { providedIn: 'root', factory: function () { return undefined; } });
/*
* Public API Surface of ngx-window-token
*/
/*
* Public API Surface of ngx-window-token
*/
/**
* Generated bundle index. Do not edit.
*/
/**
* Generated bundle index. Do not edit.
*/
exports.WINDOW = WINDOW;
exports.WINDOW = WINDOW;
Object.defineProperty(exports, '__esModule', { value: true });
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=ngx-window-token.umd.js.map

@@ -1,2 +0,2 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("ngx-window-token",["exports","@angular/core"],n):n((e=e||self)["ngx-window-token"]={},e.ng.core)}(this,(function(e,n){"use strict";var o=new n.InjectionToken("WindowToken","undefined"!=typeof window&&window.document?{providedIn:"root",factory:function(){return window}}:void 0);e.WINDOW=o,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("ngx-window-token",["exports","@angular/core"],n):n((e=e||self)["ngx-window-token"]={},e.ng.core)}(this,(function(e,n){"use strict";var o=new n.InjectionToken("WindowToken","undefined"!=typeof window&&window.document?{providedIn:"root",factory:function(){return window}}:{providedIn:"root",factory:function(){}});e.WINDOW=o,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ngx-window-token.umd.min.js.map
import { InjectionToken } from '@angular/core';
export const WINDOW = new InjectionToken('WindowToken', typeof window !== 'undefined' && window.document ? { providedIn: 'root', factory: () => window } : undefined);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2luZG93LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXdpbmRvdy10b2tlbi9zcmMvbGliL3dpbmRvdy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRy9DLE1BQU0sQ0FBQyxNQUFNLE1BQU0sR0FBRyxJQUFJLGNBQWMsQ0FDdEMsYUFBYSxFQUNiLE9BQU8sTUFBTSxLQUFLLFdBQVcsSUFBSSxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxFQUFFLFVBQVUsRUFBRSxNQUFNLEVBQUUsT0FBTyxFQUFFLEdBQUcsRUFBRSxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQzdHLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3Rpb25Ub2tlbiB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5cclxuXHJcbmV4cG9ydCBjb25zdCBXSU5ET1cgPSBuZXcgSW5qZWN0aW9uVG9rZW48V2luZG93PihcclxuICAnV2luZG93VG9rZW4nLFxyXG4gIHR5cGVvZiB3aW5kb3cgIT09ICd1bmRlZmluZWQnICYmIHdpbmRvdy5kb2N1bWVudCA/IHsgcHJvdmlkZWRJbjogJ3Jvb3QnLCBmYWN0b3J5OiAoKSA9PiB3aW5kb3cgfSA6IHVuZGVmaW5lZFxyXG4pO1xyXG4iXX0=
export const WINDOW = new InjectionToken('WindowToken', typeof window !== 'undefined' && window.document
? { providedIn: 'root', factory: () => window }
: { providedIn: 'root', factory: () => undefined });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2luZG93LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXdpbmRvdy10b2tlbi9zcmMvbGliL3dpbmRvdy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRS9DLE1BQU0sQ0FBQyxNQUFNLE1BQU0sR0FBRyxJQUFJLGNBQWMsQ0FDdkMsYUFBYSxFQUNiLE9BQU8sTUFBTSxLQUFLLFdBQVcsSUFBSSxNQUFNLENBQUMsUUFBUTtJQUMvQyxDQUFDLENBQUMsRUFBRSxVQUFVLEVBQUUsTUFBTSxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsQ0FBQyxNQUFNLEVBQUU7SUFDL0MsQ0FBQyxDQUFDLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxPQUFPLEVBQUUsR0FBRyxFQUFFLENBQUMsU0FBUyxFQUFFLENBQ25ELENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3Rpb25Ub2tlbiB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5leHBvcnQgY29uc3QgV0lORE9XID0gbmV3IEluamVjdGlvblRva2VuPFdpbmRvdyB8IHVuZGVmaW5lZD4oXG5cdCdXaW5kb3dUb2tlbicsXG5cdHR5cGVvZiB3aW5kb3cgIT09ICd1bmRlZmluZWQnICYmIHdpbmRvdy5kb2N1bWVudFxuXHRcdD8geyBwcm92aWRlZEluOiAncm9vdCcsIGZhY3Rvcnk6ICgpID0+IHdpbmRvdyB9XG5cdFx0OiB7IHByb3ZpZGVkSW46ICdyb290JywgZmFjdG9yeTogKCkgPT4gdW5kZWZpbmVkIH1cbik7XG4iXX0=
import { InjectionToken } from '@angular/core';
const WINDOW = new InjectionToken('WindowToken', typeof window !== 'undefined' && window.document ? { providedIn: 'root', factory: () => window } : undefined);
const WINDOW = new InjectionToken('WindowToken', typeof window !== 'undefined' && window.document
? { providedIn: 'root', factory: () => window }
: { providedIn: 'root', factory: () => undefined });

@@ -5,0 +7,0 @@ /*

import { InjectionToken } from '@angular/core';
export declare const WINDOW: InjectionToken<Window>;
export declare const WINDOW: InjectionToken<Window | undefined>;

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"WINDOW":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":26},"arguments":["WindowToken",{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"error","message":"Expression form not supported","line":5,"character":2,"module":"./lib/window"},"right":"undefined"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"window"},"member":"document"}},"thenExpression":{"__symbolic":"error","message":"Lambda not supported","line":5,"character":84,"module":"./lib/window"},"elseExpression":{"__symbolic":"reference","name":"undefined"}}]}},"origins":{"WINDOW":"./lib/window"},"importAs":"ngx-window-token"}
{"__symbolic":"module","version":4,"metadata":{"WINDOW":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":2,"character":26},"arguments":["WindowToken",{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"error","message":"Expression form not supported","line":4,"character":1,"module":"./lib/window"},"right":"undefined"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"window"},"member":"document"}},"thenExpression":{"__symbolic":"error","message":"Lambda not supported","line":5,"character":35,"module":"./lib/window"},"elseExpression":{"__symbolic":"error","message":"Lambda not supported","line":6,"character":35,"module":"./lib/window"}}]}},"origins":{"WINDOW":"./lib/window"},"importAs":"ngx-window-token"}

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/maxisam/ngx-window-token",
"version": "4.0.0",
"version": "5.0.0-beta01",
"author": {

@@ -8,0 +8,0 @@ "name": "Sam Lin",

@@ -1,27 +0,73 @@

# NgxWindowToken
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/)
[![travis build](https://img.shields.io/travis/maxisam/ngx-window-token.svg?style=flat-square)](https://travis-ci.org/maxisam/ngx-window-token)
[![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.0.1.
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.
## Development server
# ngx-window-token
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
It is the same way how angular handle document. With this module, you can use WINDOW token just like DOCUMENT token.
## Code scaffolding
# Breaking Change after version 5.0.0
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
return undefine if window is undefine. Before, it doesn't even inject WindowToken.
## Build
# Breaking Change after version 1.0.2
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
removed now-unnecessary `NgxWindowTokenModule`, it will be inject into root module
## Running unit tests
# Breaking Change after version 1.0.0
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
change `WindowTokenModule` -> `NgxWindowTokenModule`
## Running end-to-end tests
## Dependencies
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
- Angular >=6.0.0
## Further help
## Install
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
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)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet