2
完全に機能する 'locals'属性を使用して、md-Dialogに情報を送信します。 ユーザーがボタンを押すと、彼は$ resourceメソッドを通していくつかの情報を送り、応答を得ます。 私のMDダイアログが閉じられた後に、その応答を表示する必要があります。 最初のコントローラにどのように応答を送信しますか?ここでAngularjs mdDialog - 最初のコントローラにデータを返す方法
は高度で>
//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);
})
};
}
おかげ例です。