我使用“locals”属性向我的 md-Dialog 发送一些信息,该属性完美运行。用户按下按钮后,他将通过 $resource 方法发送一些信息并得到响应。我需要在我的 md 对话框关闭后显示该响应。如何将该响应发送到我的第一个控制器?
这是示例:
//Main controller
app.controller('Postulation_Ctrl', function($scope, $mdDialog,Postulation, Lista_Complejos){
//md-dialog function
$scope.showPrompt = function(ev){
var parentEl = angular.element(document.body);
var confirm = $mdDialog.show({
parent: parentEl,
locals: {
values: $scope.values,
},
targetEvent: ev,
t templateUrl: 'view/example.html',
controller: function DialogController($scope, $mdDialog, valores, postulaciones,user_id, Postulation) {
$scope.result = values;
$scope.createPostulation = function(){
$scope.postulation = {};
//some logic
auxPostulation = new Postulation($scope.postulation);
auxPostulation.$save(null, function(){
$scope.queryPost();
);
}
$mdDialog.hide();
}
$scope.queryPost = function() {
Postulation.query(function(response){
$scope.postulations = response; <----------I NEED TO SEND BACK THIS RESPONSE!!
},function(error){
console.log(error);
})
};
}