I have a sidebar which I collapse based on a value in $scope
(let's say $scope.open
for easy understanding). At the moment, when you click on the close/open button it just toggles that value, but if the menu is open it's going to look really ugly on mobile devices or small windows. So, I want to close the menu (set $scope.open
to false
) if the user is on a mobile sized device or using a small screen. Normally in CSS I would just use @media...
and create a media query to add some styles on mobile devices, but in this case I want to do something similar but with a $scope
variable.
Basically I want to do the equivalent of a media query but with my $scope.open
variable to make sure the menu minimizes when on mobile. Any ideas?