Skip to content

Instantly share code, notes, and snippets.

@eppleton
eppleton / Todo.java
Last active Oct 19, 2015 — forked from eppleton/Todo.java
Knockout API Tutorial - Sample 2
View Todo.java
package com.dukescript.tutorial;
import net.java.html.json.Model;
import net.java.html.json.Property;
@Model(className = "PersonList", properties = {
@Property(name = "persons", type = Person.class, array = true)})
public class ViewModel {
@Model(className = "Person", properties = {
@eppleton
eppleton / Todo.java
Last active Oct 6, 2015 — forked from eppleton/Todo.java
Knockout API Tutorial - Sample 3
View Todo.java
package com.dukescript.tutorial;
import net.java.html.json.Model;
import net.java.html.json.Property;
@Model(className = "PersonList", properties = {
@Property(name = "persons", type = Person.class, array = true)})
public class ViewModel {
@Model(className = "Person", properties = {
@eppleton
eppleton / Todo.java
Last active Aug 29, 2015 — forked from eppleton/Todo.java
Knockout API Tutorial - Sample 4
View Todo.java
package com.dukescript.tutorial;
import net.java.html.json.Model;
import net.java.html.json.Property;
import net.java.html.json.ComputedProperty;
import net.java.html.json.Function;
@Model(className = "PersonList", properties = {
@Property(name = "persons", type = Person.class, array = true)})
@eppleton
eppleton / Todo.java
Last active Aug 29, 2015 — forked from eppleton/Todo.java
Knockout API Tutorial - Sample 5
View Todo.java
package com.dukescript.tutorial;
import net.java.html.json.Model;
import net.java.html.json.Property;
import net.java.html.json.ComputedProperty;
import net.java.html.json.Function;
@Model(className = "PersonList", properties = {
@Property(name = "persons", type = Person.class, array = true)})
@eppleton
eppleton / Todo.java
Last active Nov 30, 2015 — forked from jtulach/Todo.java
Knockout API Tutorial - Sample 1
View Todo.java
package com.dukescript.tutorial;
import net.java.html.json.Model;
import net.java.html.json.Property;
@Model(className = "Person",properties = {
@Property(name = "name", type = String.class),
@Property(name = "age", type = int.class)})
public class ViewModel {
@eppleton
eppleton / HelloWorld.java
Last active Aug 29, 2015 — forked from jtulach/NamesModel.java
Shows usage of @function callback
View HelloWorld.java
package dew.demo.namesmodel;
import java.util.List;
import net.java.html.json.Function;
import net.java.html.json.Model;
import net.java.html.json.ModelOperation;
import net.java.html.json.OnReceive;
import net.java.html.json.Property;
@Model(className = "Repositories", properties = {
@eppleton
eppleton / Sample.java
Last active Dec 28, 2015 — forked from jtulach/Sample.java
Spinning Duke by Ivar
View Sample.java
package dew.demo.duke2brwsr;
import net.java.html.json.*;
@Model(className = "Data", properties = {
@Property(name = "image", type = String.class),
@Property(name = "buttonText", type =String.class),
@Property(name = "on", type = boolean.class)
})
class Duke2Brwsr {
static {