# ng2-utils

> ng2-ui utility functions

Latest version **0.6.1** (published 2017-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install ng2-utils
pnpm add ng2-utils
yarn add ng2-utils
bun add ng2-utils
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.1 |
| Published | 2017-01-23 |
| First published | 2016-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Allen Kim |
| Maintainers | allenkim |

## Links

- npm: https://www.npmjs.com/package/ng2-utils
- Repository: https://github.com/ng2-ui/ng2-utils
- Homepage: https://github.com/ng2-ui/ng2-utils#readme
- Issues: https://github.com/ng2-ui/ng2-utils/issues
- npm.io page: https://npm.io/package/ng2-utils

## Dependencies (2)

- [js-beautify](https://npm.io/package/js-beautify.md) ^1.6.4
- [@types/js-beautify](https://npm.io/package/@types/js-beautify.md) 0.0.28

## Recent versions

- 0.6.1 (latest) — 2017-01-23
- 0.6.0 — 2016-12-31
- 0.5.1 — 2016-12-21
- 0.5.0 — 2016-12-15
- 0.4.1 — 2016-10-14
- 0.4.0 — 2016-09-11
- 0.2.0 — 2016-08-27
- 0.1.4 — 2016-08-03
- 0.1.3 — 2016-07-29
- 0.1.2 — 2016-07-29
- 0.1.1 — 2016-07-29
- 0.1.0 — 2016-07-17

## README

# ng2-utils

NG2-UI utility functions

## Install

1. install ng2-utils

        $ npm install ng2-utils --save

## Use it in your code

App Component

        import { Ng2UtilsModule } from 'ng2-utils';

        import { AppComponent }   from './app.component';

        @NgModule({
          imports: [BrowserModule, Ng2UtilsModule],
          declarations: [AppComponent],
          bootstrap: [ AppComponent ]
        })
        export class AppModule { }

        platformBrowserDynamic().bootstrapModule(AppModule);

Javascript

        import { elementVisible, computedStyle, scrollTo, outerHeight, outerWidth } from 'ng2-utils';
        
HTML

        {{myHtml | htmlCode}}
        {{myHtml | htmlCode:'include'}}
        {{myHtml | htmlCode:'-include'}}
        {{ngOnInit | jsCode}}
        
## DOM-related functions

  * computedStyle(element, styleName)
    * returns style value
      
  * elementVisible(innerElement, outerElement)
    * returns visiblility of top, bottom, left, and right 
      
  * outerHeight(element)
    * return height in number
      
  * outerWidth(element)
    * return width in number
      
  * scrollTo(selector, parentCssSelector)
  
    * scrolls to a certain section in a second
    * returns void

## pipes

  * string | htmlCode:'include,-exclude'
    * returns html string with tags included and excluded 
    
  * string | jsCode
    * returns beautified Javascript code

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