Reputation: 13843
Just need to fix this errors. If it helps this app uses AngularJS. TypeScript version is 0.9.0.0
/path/app/scripts/Application.ts(22,13):
error TS2081: Supplied parameters do not match any signature of call target.
/path/app/scripts/Application.ts(22,13):
error TS2087: Could not select overload for 'call' expression.
Application.ts
import controllers = module("scripts/Controllers");
var app = angular.module('myApp', ['ngResource', 'templates-main']);
app.controller(controllers.data);
22,13 points to app.controller(controllers.data);
Module "scripts/Controllers"
export var data = {
"MainCtrl": ($scope) => {
$scope.login = ()=> {
console.log('do something');
}
}
};
Upvotes: 2
Views: 1226
Reputation: 29434
Try using this:
(<any> app).controller(controllers.data);
The statement <Type> Variable
"converts" (in the sense of changing the assumed type by TypeScript) the variable to the given type.
And since we convert it to the any type, TypeScript lets us do anything we want with it.
If you want to fix the real cause, you could edit the TypeScript definition file you're using.
Upvotes: 4