Hi,
Just getting started with Ionic/Angular so apologies if this is a silly question.
I’m trying to get an ion-side-menu
that changes size depending on the user’s screen resolution.
I’ve got something like this:
<ion-side-menu side="left" width="{{width}}">
Which works fine on the initial page load.
The trouble is if the user resizes the screen (or, more to the point, rotates their device to landscape)
I have this code to watch the resize event and update the width:
$scope.$watch(function(){
return $window.innerWidth;
}, function(value) {
$scope.width = value * 0.4;
});
But this doesn’t seem to work - when the side menu is toggled it only comes out to the width it had when the page first loaded - not the new width caused by the user switching to landscape.
I’m guessing the width is stored somewhere on first load and not subsequently updated.
Anyone have any ideas how I could get this to work?
Many thanks!