Hi, I’m having a problem when trying to assign a scope to my modal.
This is the way I’m doing my controllers:
(function () {
'use strict';
angular
.module('pg.accounts')
.controller('Wallet', Wallet);
Wallet.$inject = ['$ionicModal'];
function Wallet($ionicModal) {
var vm = this;
vm.displayTransactionDetail = displayTransactionDetail;
vm.hideTransactionDetail = hideTransactionDetail;
$ionicModal.fromTemplateUrl('app/accounts/transaction-detail.modal.html', {
scope: null
}).then(function (modal) {
vm.modal = modal;
});
function displayTransactionDetail(transaction) {
vm.modal.show();
};
function hideTransactionDetail() {
vm.modal.hide();
};
};
})();
I’m able to open the modal, but I can’t close it. In the code above I’m assigning a null scope, if I remove that line I’m still able to open the modal. Also I’m adding the controller in this way to my view (not the modal):
<ion-view view-title="Wallet balance" data-ng-controller="Wallet as vm">
Have you tried something like this? Any ideas?
Thanks in advance.