Dependency Injection
doktordirk opened this issue · comments
Following works in the app, but with aurelia-testing the element does not get created. There is no error message.
import {bindable, BindingEngine} from 'aurelia-framework';
import {inject} from 'aurelia-dependency-injection';
@inject(BindingEngine)
export class MyComponent {
@bindable firstName;
constructor(bindingEngine,) {
this.bindingEngine = bindingEngine;
}
maybe related:
function 'processor' does not get called in aurelia-testing:
import {processContent} from 'aurelia-templating';
function processor(compiler, resources, node, instruction){
console.log(compiler, resources, node, instruction);
return true;
}
@processContent(processor)
export class MyAttributeCustomAttribute {
static inject = [Element];
constructor(element) {
this.element = element;
}
valueChanged(newValue){
this.element.style.backgroundColor = newValue;
}
}
@martingust Can you take a look?
@EisenbergEffect I'm on vacation for another week or so without access to computer. If no one else have looked into this before I get back I will.
might be the reason aurelia/framework#480
@doktordirk you may want to try and add a timeout. The quickest way is to replace the 0
at the end of this line by a reasonably high number of milliseconds. Of course you'll have to replace it in the transpiled code, in the jspm package folder for aurelia-testing.
If it works with a timeout, then it's likely to be related.
re timeout: i played with it, but to no avail. but considering i get component.dispose undefined or something, it still seem related (since it'll get defined within some promise and no-one waited for it to resolve apparently)
any news?
hmm, samples i gave above work fine now.