return{ // The following code can be found 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 attempted to send data to the **response** in index.js but an empty string or undefined is being displayed
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);
};
I am unable to pass an observable data when closing a popup, even when I tried this code (dialog.close(this,ko.toJS(self.Name))).....I cannot retrieve the data in response, but if I pass a string it is available in the response