So here is the im condition that is having problems, it looks like I have a parent controller and a child controller that is a modal controller, I have a method in the parent controller that I want to call from a child modal controller, I donβt know what im missing, but this is what I tried.
App.controller('MailFolderController', ['$scope', '$http', '$timeout', '$stateParams', '$window', 'mails', '$interval', function ($scope, $http, $timeout, $stateParams, $window, mails, $interval) { $scope.check = function(){ console.log("call parent ==========>") } App.controller('orderCancellationController', ['$scope', '$modal', function ($scope, $modal) { $scope.open = function (mail) { var modalInstance = $modal.open({ templateUrl: '/orderCancellationBox.html', controller: ModalInstanceCtrl, resolve: { mail: function () { return mail; } } }); }; // Please note that $modalInstance represents a modal window (instance) dependency. // It is not the same as the $modal service used above. var ModalInstanceCtrl = function ($scope, $modalInstance, mail) { $scope.mail = mail; $scope.submit = function () { $scope.$parent.check(); $modalInstance.close('closed'); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; }; ModalInstanceCtrl.$inject = ["$scope", "$modalInstance", 'mail']; }]); }]);
but it gives me an error, not such a function, I get an error on the verification method, I want to call this verification method from the modal instance controller, but could not do it, please help.
user5409301
source share