Get return value of a function using notifySubscribers
问题 I got two different view models and I need to call a function in one view model from other. To acheive this i try to use ko.subscribable() var postbox=new ko.subscribable();// global variable EmployeeViewModel postbox.subscribe(function (showAlert) { return that.ValidateEmployees(showAlert); }, that, 'ValidateEmps'); that.ValidateEmployees=function(){ //validation logic return true/false; } TaxCalculatorViewModel var isEmpValid = postbox.notifySubscribers(true, "ValidateEmps"); if (