UNPKG

aurelia-kendoui-bridge

Version:

A set of Telerik KendoUI wrappers for Aurelia allowing developers to easily use KendoUI components in their Aurelia application.

46 lines (38 loc) 1.11 kB
import {inject} from 'aurelia-dependency-injection'; import {customElement} from 'aurelia-templating'; import {WidgetBase} from '../common/widget-base'; import {generateBindables} from '../common/decorators'; import {constants} from '../common/constants'; import {PDF} from '../pdf/pdf'; //eslint-disable-line no-unused-vars @customElement(`${constants.elementPrefix}chart`) @generateBindables('kendoChart') @inject(Element, WidgetBase) export class Chart { constructor(element, widgetBase) { this.element = element; this.widgetBase = widgetBase .control('kendoChart') .useElement(this.element) .linkViewModel(this); } subscribe(event, callback) { return this.widgetBase.subscribe(event, callback); } bind(ctx, overrideCtx) { this.widgetBase.useParentCtx(overrideCtx); } attached() { if (!this.kNoInit) { this.recreate(); } } recreate() { this.kWidget = this.widgetBase.recreate(); } destroy() { this.widgetBase.destroy(this.kWidget); } detached() { this.destroy(); } }