Created
October 7, 2014 15:20
-
-
Save markusjohnsson/d7124998cd766b143db7 to your computer and use it in GitHub Desktop.
Kendo view model with ES5 properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <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