I’ve been using ionic-core 4 in my project, everything was working fine, Few days ago, i migrated to ionic5, everything worked great (on latest browsers) after doing some minor changes, but my SideMenu stopped working. I noticed ionic5 implementation(way of use) for SideMenu totally replaced ionic4.
- ionic 4
const menuCtrl = document.querySelector('ion-menu-controller');
function openFirst() {
menuCtrl.enable(true, 'first');
menuCtrl.open('first');
}
- ionic 5
<script type="module">
import { menuController } from '@ionic/core';
window.menuController = menuController;
</script>
function openFirst() {
menuController.enable(true, 'first');
menuController.open('first');
}
You see, the actual functions are same like open/enable etc but the way you gonna import SideMenu has changed. For some reasons, my (clients) project needs to run on old browsers which dont support import/module.
So is there a way to run ionic5 SideMenu on old browsers too like ionic4 was ???