I keep encountering a strange issue where my app freezes whenever I include ng-show in my popover.html. However, when I comment it out, the app functions properly. I'm really struggling to understand what's causing this problem in my code.
Below is my popover.html:
<ion-popover-view> <ion-content>
<div ng-show="showsettingButton()">
<ion-item menu-close ng-click="logout()"> Sign Out <span
class="item-icon-right"><i class="ion-chevron-right"></i></span> </ion-item>
<ion-item menu-close ui-sref="app.profile"> Settings <span
class="item-icon-right"><i class="ion-chevron-right"></i></span> </ion-item>
</div>
<div class="list" ng-repeat="title in Titlelist">
<a class="item"
ng-click="openpage(title.page_title,title.page_content)">
{{title.page_title}} </a>
</div>
</ion-content> </ion-popover-view>
These are the functions in my controller:
app
.controller(
'MenuCtrl',
function($scope, LocalStorage, $stateParams, $rootScope,
$state, store, ngCart, $window, $ionicHistory,
DataService, $ionicLoading, $ionicPopup, $http,
$ionicSideMenuDelegate, $ionicPopover) {
$scope.showsettingButton = function() {
$scope.popover.hide();
if (LocalStorage.getData("userId")) {
if (LocalStorage.getData("userId") !== "undefiened") {
DataService.setbooleanIsUserLoggedIn(true);
} else {
DataService.setbooleanIsUserLoggedIn(false);
}
} else {
DataService.setbooleanIsUserLoggedIn(false);
}
return DataService.getbooleanIsUserLoggedIn()
}
$ionicPopover.fromTemplateUrl('templates/popover.html', {
scope : $scope,
}).then(function(popover) {
$scope.popover = popover;
});
$scope.openpage = function(Pagetitle, Pagecontent) {
$scope.popover.hide();
var jsonObject = {
title : Pagetitle,
content : Pagecontent
}
DataService.addcontent(jsonObject)
$state.go('app.extraPage');
}
});
If I remove this line
<div ng-show="showsettingButton()"> <div/>
, my app works fine.
Any assistance with this issue would be greatly appreciated
Thank you.