Skip to content

Instantly share code, notes, and snippets.

@markusjohnsson
Created October 7, 2014 15:20
Show Gist options
  • Save markusjohnsson/d7124998cd766b143db7 to your computer and use it in GitHub Desktop.
Save markusjohnsson/d7124998cd766b143db7 to your computer and use it in GitHub Desktop.
Kendo view model with ES5 properties
/// <reference path="../Kendo/typescript/kendo.web.d.ts"/>
/// <reference path="../Scripts/typings/jquery/jquery.d.ts"/>
class ViewModel extends kendo.data.ObservableObject {
private _text = "asd";
public set theText(v: string) {
if (this._text == v) return;
this._text = v;
this.trigger('change', { field: 'theText', value: v });
}
public get theText() {
return this._text;
}
clicker = () => {
this.theText = "HELLO USABLE BINDINGS";
}
constructor() {
super();
this.init(this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment