Access $ionicPopup() outside controller.?

I want to access $ionicPopup() outside controller ? i.e. in an external js file. is that possible?

Yes, it works for me:

//my view
< button class=“button button-clear” ng-click=“test()”></ button> //there are spaces on the tags to show on the comment

//my controller
myApp.controller(‘Home’, function($scope, $ionicPopup) {
$scope.test= function (){

// external js file
function test2(popup) {
title: ‘Error!’,
template: 'I don’t know! :confused: '

1 Like