sree sree - 1 year ago 163
AngularJS Question

using $ionic Popup

Hi Im using ionic to create a simple popup. Here Im not able to display the pop-up information after clicking the button. I don't know where Im going wrong and please help me in displaying the pop-up .And Im getting error

ionic.bundle.js:26794 TypeError: Cannot read property 'show' of undefined
at Scope.$scope.showPopup


$scope.showPopup = function() {
title:'select car wash',
template: "Hello customer !!!",

console.log('Inside pop-up');

Answer Source

You messed in Dependency injection, you have to inject $ionicPopup to use it in controller factory function.

.controller('popSelect',['$scope', '$ionicPopup', //<-- injected $ionicPopup here
   function($scope, $ionicPopup){ //<-- now you can access $ionicPopup instance here.