Hey again guys,
ionic is of course still very new to me and i’m a bit embarrassed to ask this, but i don’t know where to get a deeper look into these things (combined jQuery, Angular and ionic).
I know, the target is to totaly remove jQuery while using ionic and angular (what i saw till now was totaly great and the free course on codeschool was great to get a first overview.
So, i’m now using jQuery mobile for my single page application. It’s very easy for me to generate single pages and the navigation of course isn’t difficult.
I now want to call a function, which closes my menu after a pagechange has been done. Therefore i have a function which looks like this ->
jQuery(document).on("pageshow", function (e, data) {
console.log('PAGE CHANGED');
})
While this function works fine, i now need to know, whether the menu is opened or not. I got this function for that inside my MainCtrl (it gets updated everytime the menu changes it’s state) ->
sideMenuToggled = $ionicSideMenuDelegate.isOpen();
What i want my function now to do is sth which must look like this:
jQuery(document).on("pageshow", function (e, data) {
console.log('PAGE CHANGED');
if(sideMenuToggled == true) {
$ionicSideMenuDelegate.toggleRight();
}else{
console.log('side menu is closed already');
}
})
So that function should close the side menu when it is opened. I know that there is an attribute called menu-close
and i already tried to use that instead of a function but it doesn’t get triggered - the menu still stayes opened.
<ion-item menu-close>
<a href="/#searchPage" class="blockedLink" data-tap-disabled="true" data-transition="none">
<i class="fa fa-search fa-2x fa-fw abso"></i><p class="navigationPoints">Search</p>
</a>
</ion-item>
any help would be appreciated - how can i use ionic within jquery?