Skip to content

Instantly share code, notes, and snippets.

@JeroenVinke
Created July 29, 2017 17:30
Show Gist options
  • Save JeroenVinke/4442479dd7c88449a844ef0a17175f57 to your computer and use it in GitHub Desktop.
Save JeroenVinke/4442479dd7c88449a844ef0a17175f57 to your computer and use it in GitHub Desktop.
bind(ctx, overrideCtx) {
this.widgetBase.useParentCtx(overrideCtx);
if (this.kWidget) {
// this had to be kValue and not value
this.kWidget.value(this.kValue);
}
}
<template>
<button click.delegate="create()">New Person</button>
<table with.bind="person">
<tr>
<td>Name</td>
<td><input type="text" value.two-way="Name" /></td>
</tr>
<tr>
<td>Age</td>
<td>
<input type="text" value.two-way="Age" />
</td>
</tr>
<tr>
<td>Age in Combobox</td>
<td>
<ak-combobox k-value.two-way="Age">
</ak-combobox>
</td>
</tr>
</table>
</template>
export class Test {
person = null;
create() {
this.person = new Person();
this.person.Age = '' + Math.random() * 100;
this.person.Name = "Name";
}
}
export class Person {
Name = undefined;
Age = null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment