Changing status bar color on side menu toggle


#1

Hi,

Is it possible to change the status bar color when the side menu gets toggled?


#2

You can use the statusbar plugin:
https://github.com/apache/cordova-plugin-statusbar/blob/master/doc/index.md


#3

The problem is not actually changing the color because I can do that using the ngCordova but the problem is to detect whether the side menu is open or closed using some sort of watcher.


#4

you do not need a watcher for that:
http://ionicframework.com/docs/api/service/$ionicSideMenuDelegate/

there is a function called isOpen() :wink:


#5

I need to monitor the value for the isOpen() to check if the side menu is open or not.


#6

Ah okay you have the “canDragContent” on?

If not you can open the sidebar on your own via ng-click on the sidemenu button -> then you can toggle your sidebar and check if it was open or closed.

But you can truly use a watcher on this.

*it was a long day for me… ^^