Closed vegarringdal closed 5 years ago
I was wrong, auto inject works fine as long as its not Element
workaround is
declare class Element {}
import {autoinject} from 'aurelia-framework';
declare class Element {}
@autoinject
export class BlurImageCustomAttribute {
constructor(private element: Element) {
this.element = element;
}
public valueChanged(newImage: HTMLImageElement) {
if (newImage.complete) {
drawBlur(this.element, newImage);
} else {
newImage.onload = () => drawBlur(this.element, newImage);
}
}
}
Looks like the typescript helper plugin is needed for this