I am facing a challenge in my AngularJS application where I need to dynamically control the overflow on the body element. Specifically, when a side nav is opened, I want to disable scrolling on the body. Below is a snippet of my code and I would appreciate any suggestions or hints on how to tackle this issue:
HTML:
<body ng-controller="backgroundCtrl as background" md-theme="blue-grey" ng-style="{'overflow-y': background.lockBackgroundTrue}">
Controller:
controller('backgroundCtrl',function(){
this.lockBackgroundFalse = 'auto';
this.lockBackgroundTrue = 'hidden ';
});
Any assistance with this matter would be highly valued. If achieving this directly is not feasible, alternative approaches are also welcome. Thank you in advance.