I'm not able to pass via $ctrl.close(data)
to controller
using that component
:
uibModal that I'm using:
angular.module('sisApcd').component('buscaPessFis', {
templateUrl: 'app/components/buscaPessFis/pessFisBusca.html',
bindings: {
resolve: '<',
close: '&',
dismiss: '&'
},
/// Controller do Component de buscaPessFis
controller: function ($scope) {
var $ctrl = this;
$ctrl.$onInit = function () {
};
// Acoes click
$scope.ok = function (e) {
var valor = e.target.attributes['id-user'].value;
$ctrl.close({valor2: 'teste'});
};
$scope.cancel = function () {
$ctrl.dismiss({valor2: 'teste'});
};
}
});
Where to call the component:
modalInstance.result.then(function (data) {
console.log(data);
}, function () {
$log.info('Modal dismissed at: ' + new Date());
});
And it returns me
undefined