We were using TypeScript 2.2. After upgrading to 2.4, we now get this on compilation:
error TS2345: Argument of type \'typeof TopMenuController\' is not
I also faced the same issue which I got resolved by
implementing IController
add this code before constructor (or anywhere in code this is my preference) $onInit = () => { };
here is the full code, Hope this will give a clear view
module MyApp {
export class HomeController implements angular.IController {
$onInit = () => { };
user: string;
constructor() {
this.user = "mali";
}
}
angular.module('app').controller('homeController', MyApp.HomeController)
}
Happy Coding