SideMenu getOpenRatio equals 1 or 0 when toggled

I want to add black opacity for side menu when it’s partially opened.
I’m using for that

$scope.$watch(function () {
    return $ionicSideMenuDelegate.getOpenRatio();
}, function (newValue, oldValue) {
    opacityElement.style.opacity = 1 - newValue;
});

If I swipe the content it works great. But when I press menu toggle button getOpenRatio gets 1 || 0 without values between.