# ng2-if-scrollbars

> The Angular 2 directive determines if the DOM element has scrollbars

Latest version **2.0.0** (published 2017-05-18) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install ng2-if-scrollbars
pnpm add ng2-if-scrollbars
yarn add ng2-if-scrollbars
bun add ng2-if-scrollbars
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-05-18 |
| First published | 2016-10-05 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Vadym Milichev |
| Maintainers | milichev, vadym_milichev |
| Keywords | angular, scrollbar, css |

## Links

- npm: https://www.npmjs.com/package/ng2-if-scrollbars
- Repository: https://github.com/milichev/ng2-ifscrollbars
- Homepage: https://github.com/milichev/ng2-ifscrollbars#readme
- Issues: https://github.com/milichev/ng2-ifscrollbars/issues
- npm.io page: https://npm.io/package/ng2-if-scrollbars

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2017-05-18
- 1.2.0 — 2017-02-01
- 1.1.3 — 2017-01-30
- 1.0.1 — 2016-10-06
- 1.0.0 — 2016-10-06
- 0.1.0 — 2016-10-05
- 0.0.2 — 2016-10-05
- 0.0.1 — 2016-10-05

## README

# ng2-if-scrollbars

The Angular 2 directive determines if the DOM element has scrollbars.
When vertical or horizontal scroll bar is visible, it adds `ng2-if-scrollbars-vertical` 
or `ng2-if-scrollbars-horizontal` CSS classes on the element. This is useful when 
the styling is dependent on the scrollbars visibility.

## Installation

```
npm i --save ng2-if-scrollbars
```

## Usage

The package module needs to be imported in the application module where the directive is used:
 
```
import {IfScrollbarsModule} from 'ng2-if-scrollbars';

@NgModule({
    imports: [
        IfScrollbarsModule
    ],
    exports: [
        IfScrollbarsModule
    }
})
export class AppModule {
}

```

Template:

```
<div
    [ng2IfScrollbars]
    style="
        height: 100px; 
        width: 200px; 
        overflow: auto;
    ">
    <div style="
        height: 150px;
        width: 150px;
    "></div>
</div>
```

The `ng2-if-scrollbars-vertical` CSS class will be added on the top `div` element.

The state of scrollbars is updated on the element DOM change or `Window` resize.


## Contribution

Please fork and do your improvements according 
to the [Angular 2 style recommendations](https://angular.io/styleguide).

### Testing

The project contains Karma configuration for unit testing the code. You can run it either with
 
```
npm run test
```

or connecting the `karma.conf.js` 
to [your favourite IDE](https://www.jetbrains.com/help/webstorm/2016.2/running-unit-tests-on-karma.html).

## License

GPL-3.0

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