How do I use knockoutjs with ScriptSharp?
As I have just learnt the Script# that I don't know how to use knockoutjs with ScriptSharp. I tried to read through the KnockoutAPI but I am still confused how to write even just a view Model containing just开发者_StackOverflow中文版 few knockout Observables and how to use the basic function like GetValue and SetValue.
Thanks for your attention.
You can do something like this:
public class MyViewModel {
public Observable<string> firstName = Knockout.Observable<string>("Bob");
}
public static class App {
static App() {
MyViewModel vm = new MyViewModel();
Knockout.ApplyBindings(vm);
}
}
Hope that gets you started.
精彩评论