Angular Body Scroll Lock
This is an Angular library that implements the body-scroll-lock, which can have minor problems in an Angular Project. The Angular Body Scroll Lock purpose is to optimize and implements Angular features, but without changing the original script logic. Every change on the body-scroll-lock package will be synchronized in this project too.
$ yarn add ng-body-scroll-lockor$ npm install ng-body-scroll-lock
Import Module/Service in your Module
Import the NgBodyScrollLockModule in your module or import NgBodyScrollLockService in your providers.
!!! Be aware that on some Angular versions it would not work importing the NgBodyScrollLockModule, in that case, you have to import the NgBodyScrollLockService in providers!
Example with module
Example with service
Import Service to use Body Scroll Lock
Import the NgBodyScrollLockService where you want to use it
||Disables body scroll while enabling scroll on target element|
||Enables body scroll and removing listeners on target element|
||Clears all scroll locks|