$watch with ionicSideMenuDelegate service


#1

$scope.$watch(function () {
return $ionicSideMenuDelegate.isOpen();
}, function (value) {
var token = JSON.parse(localStorage.getItem(‘token’));
if(token){
$scope.loggedIn = true;
}else{
$scope.loggedIn = false;
}
});

I use $watch to hide and show my menu link, is this a good solution or bad design?