Using humane.js with aurelia -
i'm trying use humane.js aurelia i'm running in problem.
it appears humane.js adds element dom when it's created , far way i've found force this....
showmessage(message) { this.notify = humane.create(); this.notify.log(message); }
however creates new instance of humane every time showmessage() called. breaks queue each 1 rendered separately.
i've tried putting create()
in activate()
method of view model doesn't seem work either.
any ideas?
this solved problem, i've created custom element humane included in app.html in same way loading-indicator in skeleton app.
import humane 'humane-js'; import 'humane-js/themes/original.css!'; import {inject, noview} 'aurelia-framework'; import { eventaggregator } 'aurelia-event-aggregator'; import { apistatus } 'resources/messages'; @noview @inject(eventaggregator) export class statusindicator { constructor(ea) { this.ea = ea; ea.subscribe(apistatus, msg => this.showmessage(msg.apistatus)); } attached() { this.humane = humane.create(); } showmessage(message) { this.humane.log(message); } }
the important part attached()
allows setup of humane work correctly.
Comments
Post a Comment