0
return{ // this code is in index.js
addItem: function() {
alert("working");
Newram.show().then(function (response) `***// Calling show functionin Newram.js***`
{
var c = response;
}
);
}}
// In Newram.js while closing the popup i tried to send data to the **response** in index.js but empty string or undefined is showing
var AddItem = function() {
var self = this;
self.Name = ko.observable('jo'),
self.Price = ko.observable(100),
self.Sales = ko.observable("good")
self.data1= {name:self.Name() };
};
AddItem.prototype.closeDialog = function() {
dialog.close(this, self.Name);
};
我不能能夠通過可觀察到的數據,同時關閉彈出即使我試圖這個代碼(dialog.close(通過一個可觀察到的數據這一點,ko.toJS(self.Name)) ).....不能夠獲得響應的數據,但如果我傳遞一個字符串它可在響應斜面能夠同時關閉彈出
'self'不'closeDialog'定義方法,嘗試用'this'代替它 –
如果我使用「this」..... self.Name沒有定義 – Joel