import { Evented } from "./Evented"; import * as $ from "jquery"; import * as handlebars from "handlebars"; import * as Hammer from "hammerjs"; /** * Widget Class */ export class Widget extends Evented { public el; public store; /** * Initialize * * This method is called subclass constructor */ public init() { // Call super class method. super.init(); if (typeof this.el == "string") { this.el = $(this.el); } } public update() { if (this.el) { var template = handlebars.compile(this.el.html()); var html = template(this.store.data); this.el.html(html); } } /** * onReady */ protected onReady() { /* var hammertime = new Hammer($("#app").get()[0], {}); hammertime.on('pan', function(ev) { console.log(ev); }); $("#app").text("ζ›Έγζ›γˆ"); */ } } // EOF