I have the following modal in my controller:
angular
.module('app', ['ui.bootstrap'])
.controller('AlunosController', function ($uibModal, $scope, MyPaginator) {
$scope.alunos = new MyPaginator('/alunos');
$scope.open = function (aluno) {
$scope.alunoOriginal = aluno;
$uibModal.open({
controller: 'ModalAlunoFormController',
resolve: {
aluno: function () {
return angular.copy(aluno);
}
}
})
};
})
.controller('ModalFormAlunoController', function ($uibModalInstance, aluno) {
$scope.aluno = aluno;
});
I can seamlessly import aluno
to controller
of modal, ModalFormAlunoController
, using the resolve
option.
But I would like to pass all objects present in $scope
from AlunosController
to ModalFormAlunoController
, without having to pass one by one via option resolve
.
How can I do this in the Angular UI Bootstrap ?