saltarelle / saltarelleknockout Goto Github PK
View Code? Open in Web Editor NEWKnockout.js bindings for the Saltarelle C# to Javascript compiler
License: Other
Knockout.js bindings for the Saltarelle C# to Javascript compiler
License: Other
to create an Observable
, the static creator Knockout.Observable<T>()
has to be called instead of the natural class constructor (which is not implemented and marked as internal
).
My proposal is to implement a proper constructor so that observables can be created with new
like in:
var h = new Observable<string>("hello");
I was thinking of something like this in Observable.cs:
[InlineCode("ko.observable()")]
public Observable() {
}
[InlineCode("ko.observable({value})")]
public Observable(T value) {
}
what do you think? IMO it would make the code nicer to read.
public void Splice(int index, int howmany, params T[] args) should be decorated with [ExpandParams] attribute since the args parameter should not be compiled as an array, but a list of items.
I've pointed to this on the forum
http://saltarellecompiler.freeforums.org/post134.html
In the latest release, ModelToObject takes only one parameter, while in a previous release it had an overload that takes an extra mapping options parameter.
In the original JS Knockout Mapping file:
https://github.com/SteveSanderson/knockout.mapping/blob/master/knockout.mapping.js
toJS (Which is named ModelToObject in Saltarelle) is defined in line 160, and it takes two parameters, rootObject and options. So, why the options parameter was removed from Saltarelle and Script#? I'm sure this parameter was in a previous release, because I wrote code that uses it.
These are used to specify the default ignore, copy, observe and include behaviours of the plugin. These are part of the plugin
https://github.com/SteveSanderson/knockout.mapping/blob/master/knockout.mapping.js
I used to add these myself while I was including Knockout as source code, but now I can't because I use the Knockout Nuget package. I can just add these as extension methods, but I hope they're added to the library.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.