For a long time I’ve been admiring the great controls created by Gerrit Grunwald (@hansolo_ on twitter). So it’s time to convert them to DukeScript. It takes a bit of effort to do that and it’s probably not what the typical DukeScript developer will do very often, but I thought I should share this anyway, because it might be of interest to some to learn more about the internals of DukeScript.
That’s it. We could bind more properties like that, but for a first version this should be the most important one.
Now let’s use the led in html:
That’s it. We can now create the ViewModel like this:
Update: Not everyting required to make this work is described here (e.g. project layout), so I’ve uploaded the example on github for you to play with.
May the force be with you!