ecmascript 6 - ES6 Class, extending Ractive -
i'm using es6 (via babel), , looking "proper" way define class extends ractive (without calling ractive.extend(...)
if possible), since ractive allows new (http://docs.ractivejs.org/latest/new-ractive).
tried following approach, seems work:
class home extends ractive { constructor() { super(); this.template = "<h1>{{message}}</h1>"; } data() { return { message: 'this sample data' } } oninit() { console.log('ok'); } }
ractive instance initialized without error, , oninit
called, template seems undefined.
i start using syntax well. :)
but spent hour month ago trying see if hackable, concluded it's not possible due how of component extension works. it's on our radar , should land in near-future version.
Comments
Post a Comment