ko promise Knockout Observable Promise
ko.promise -可观察的承诺目的这个库的目的是规范observables和promises之间的API表面,允许它们在你的应用程序中互换使用。这简化了将异步调用绑定到您的视图的过程,而无需显式等待promise的解析。例子: function vm ( ) { t// the jQuery ajax call will return a promise derivative, t// which will be turned into an observable that is set when the promise is resolved tthis . asyncResource = ko . promise ( $ . ajax ( "external/url" ) ) ; tthis . normalValue = ko . observa
用户评论