0.0.5 • Published 5 years ago

ngx-dom-wrappers v0.0.5

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

ngx-dom-wrappers

npm npm Build Status devDependencies

Prerequisites

  • Node
  • npm or yarn.

About

Angular library providing wrappers for dom types.

Table of Contents

Installation

npm install ngx-dom-wrappers

or

yarn add ngx-dom-wrappers

Usage

  1. Import DomWrappersModule in AppModule or CoreModule of your application.

AppModule

@NgModule({
  imports: [
    // Other imports
    DomWrappersModule
    // Other imports
  ],
})
export class AppModule { }

CoreModule

@NgModule({
  imports: [
    // Other imports
    DomWrappersModule
    // Other imports
  ],
  exports: [
    // Other exports
    DomWrappersModule
    // Other exports
  ],
})
export class CoreModule { }
  1. Use wrappers in your code
import { WINDOW, LOCAL_STORAGE, SESSION_STORAGE } from 'ngx-dom-wrappers'

constructor(
    @Inject(WINDOW) windowWrapper: any,
    @Inject(LOCAL_STORAGE) localStorageWrapper: any,
    @Inject(SESSION_STORAGE) sessionStorageWrapper: any,
  ) {
	const windowObject = windowWrapper as Window
	if (windowObject) {
    // Your code
  }
}

Resources

License

MIT

0.0.5

5 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago