I have a Aurelia component that I am trying to move to typescript. The component was created a long time ago and the class method bind is giving me Typescript error. I am not sure if the bind method changed names or what.
The error is: Cannot find name ‘bind’. Did you mean the static member ‘InlineView.bind’?
Here is the component:
`
export class InlineView {
viewCompiler: ViewCompiler = undefined;
viewSlot: ViewSlot = undefined;
container: Container = undefined;
viewResources: ViewResources = undefined;
interFace: any = undefined;
bindingContext: any = undefined;
constructor(viewCompiler, viewSlot, container, viewResources) {
this.viewCompiler = viewCompiler;
this.viewSlot = viewSlot;
this.container = container;
this.viewResources = viewResources;
}
attached() {
// Compile an html template, dom fragment or string into ViewFactory instance, capable of instantiating Views.
var viewFactory = this.viewCompiler.compile('<template>' + this.interFace.view.html + '</template>', this.viewResources);
// Creates a view or returns one from the internal cache, if available
var view = viewFactory.create(this.container);
// Bind the view and it's children
view.bind(this.bindingContext);
// Add the view to the slot
this.viewSlot.add(view);
// Trigger the attach for the slot and its children.
this.viewSlot.attached();
if (this.bindingContext.interFace.view.code) {
eval(this.bindingContext.interFace.view.code);
}
bind(bindingContext) {
this.bindingContext = bindingContext;
this.interFace = bindingContext.interFace;
}
}
`