あなたは以下のように()関数を非表示にするモデルで更新データを渡す必要があり
<md-input-container class="md-block" flex-gt-xs="">
<label>Titolo</label>
<input ng-model="questList.titolo" size="30" placeholder="inserisci il titolo">
</md-input-container>
以下のようなHTMLにご入力フィールドのNG-モデルを修正してください。
.controller('DemoCtrl', function($scope, $mdDialog, $mdMedia) {
$scope.status = ' ';
var questList = this;
questList.allsQ = [];
questList.openDialog = function($event) {
$mdDialog.show({
controller: function ($timeout, $q, $scope, $mdDialog) {
var quest =this;
// you will be returning quest
$scope.cancel = function($event) {
$mdDialog.cancel();
};
$scope.finish = function($event) {
$mdDialog.hide();
};
$scope.answer = function() {
//pass quest to hide function.
$mdDialog.hide(quest);
};
},
controllerAs: 'questList',
templateUrl: 'dialog.tmpl.html',
parent: angular.element(document.body),
targetEvent: $event,
clickOutsideToClose:true,
locals: {parent: $scope},
})
.then(function(quest) {
//here quest has data you entered in model
questList.allsQ.push({
titolo: quest.titolo ,
capitolo: quest.capitolo,
descrizione: quest.descrizione,
importo: quest.importo,
data: quest.data
});
questList.titolo = '';
questList.capitolo = '';
questList.descrizione = '';
questList.importo = '';
questList.data = '';
console.log(questList.allsQ);
console.log(questList.allsQ.length);
});
};
});
ありがとうございます! – litas