1
var Command = function() {
var _self = this,
//flag to indicate that the operation is running
_isRunning = ko.observable(false),
//property to save the error message
_errorMessage = ko.observable();
//public properties
this.isRunning = _isRunning;
this.errorMessage = _errorMessage;
};
爲什麼此示例同時使用私有變量和公共變量?這是我們所遵循的設計模式嗎?爲什麼我們分別使用公共和私有變量