0
我使用,充分地享受knockout.js和腳本#Knockout.js和ScriptSharp - 可寫入相關觀測量
的邪惡組合在探索相關觀測量的力量,我已經遇到需要實施documentation
中提到的可寫變體如何在腳本Sharp導入類中捕獲此ko函數?
我使用,充分地享受knockout.js和腳本#Knockout.js和ScriptSharp - 可寫入相關觀測量
的邪惡組合在探索相關觀測量的力量,我已經遇到需要實施documentation
中提到的可寫變體如何在腳本Sharp導入類中捕獲此ko函數?
我最終制作了一個新的「導入庫」項目 並定義了缺失的部分。
namespace KnockoutApi
{
[Imported]
[IgnoreNamespace]
[ScriptName("ko")]
public static class Ko
{
/// <summary>
/// Creates an observable with a value computed from one or more other values.
/// </summary>
/// <typeparam name="T">The type of the observable value.</typeparam>
/// <param name="options">Options for the dependent observable.</param>
public static DependentObservable<T> DependentObservable<T>(DependentObservableWritableOptions<T> options)
{
return null;
}
}
}
[IgnoreNamespace]
[Imported]
[ScriptName("Object")]
public class DependentObservableWritableOptions<T>
{
public DependentObservableWritableOptions()
{ }
// Summary:
// Gets or sets whether the evaluation should be deferred, i.e. not performed
// when the observable is first created.
[IntrinsicProperty]
public bool DeferEvaluation { get; set; }
//
// Summary:
// Gets or sets the function to compute the value.
[ScriptName("read")]
[IntrinsicProperty]
public Func<T> GetValueFunction { get; set; }
//
// Summary:
// Gets or sets the function to compute the value.
[ScriptName("write")]
[IntrinsicProperty]
public Action<T> SetValueFunction { get; set; }
//
// Summary:
// Gets the model instance which acts as 'this' in the get value function.
[IntrinsicProperty]
[ScriptName("owner")]
public object Model { get; set; }
}
你應該通過github上的git倉庫將這個回饋給項目。它可能會幫助其他人...... –