I'm using webpack with Babel and Typescript
I have this controller:
// HelloWorldController.ts
class HelloWorldController implements ng.IComponentController {
constructor(private $scope: ng.IScope) {
}
public over(): void {
this.$scope.color = this.change();
}
}
and his component options
export class HelloWorldComponent implements ng.IComponentOptions {
public bindings: {[binding: string]: string};
public controller: Function;
public templateUrl: string;
public constructor() {
this.bindings = {
color: '=',
change: "&"
};
this.controller = HelloWorldController;
this.templateUrl = "HelloWorld.html";
}
}
app.component('helloWorld', new HelloWorldComponent());
When I transpile this code I got this error:
error TS2339: Property 'change' does not exist on type 'HelloWorldController'
How I can access the bindings reference inside a controller with Typescript?