A simple angular directive that allows to prevent an element from scrolling whenever the user is focusing (mouseenter / touchstart) the element where this directive was applied.
npm install ngx-prevent-scroll
ngx-prevent-scroll is a simple angular directive that allows to prevent an element from scrolling whenever the user is focusing (mouseenter / touchstart) the element where this directive was applied.
-----------
Install via npm:
```
npm install --save ngx-prevent-scroll
Include the alignment module in the imports list of your app's module:
`js
import { PreventScrollModule } from "ngx-prevent-scroll";
@NgModule({
imports: [
PreventScrollModule
]
})
`
-----------
`html`
as the directive's input.`html
`$3
Add an ID to the target element and then pass it as the directive's input.`html
`-----------
Advanced
$3
This also works for dynamic targets without any additional configuration.`html
``