I’m having issue with $ionicPopup. It gives me error
ionic.bundle.js:26799 TypeError: Cannot read property ‘alert’ of undefined
at controllers.js:44
at processQueue (ionic.bundle.js:29132)
at ionic.bundle.js:29148
at Scope.$eval (ionic.bundle.js:30400)
at Scope.$digest (ionic.bundle.js:30216)
at Scope.$apply (ionic.bundle.js:30508)
at done (ionic.bundle.js:24829)
at completeRequest (ionic.bundle.js:25027)
at XMLHttpRequest.requestLoaded (ionic.bundle.js:24968)
this is my code
.controller(‘loginCtrl’, [’$scope’, ‘ionicToast’, ‘AuthService’, function($scope, $stateParams, AuthService,$location, $rootScope,$state,$ionicLoading, $ionicPopup) {
$scope.user = {
data : {
email: “”,
password: “”
}
};
$scope.userLogin = function() {
if($scope.user.data.email !== “” && $scope.user.data.password !== “” ){
//$ionicLoading.show();
AuthService.login($scope.user.data).then(function(msg) {
$rootScope.AuthCheck = AuthService.isAutheticate();
$state.go(‘app.dashboard’);
},function(errMsg) {
var alertPopup = $ionicPopup.alert({
title: ‘Invalid Email / Password’,
template: errMsg
});
});
//.finally(function() {
// $ionicLoading.hide();
//});
};
};
}])
before this it gave me .show is not defined and then this problem. How to solve it?