I'm trying to pass a class as a parameter to some function, that will instantiate this class and return it. Here is my code:
module A.Views {
export class View { ... }
}
module A.App {
export class MyApp {
...
registerView(viewKlass:A.Views.View):void
{
var test = new viewKlass;
}
}
}
When i'm trying to compile this, i'm getting:
(...): Value of type 'Views.View' is not newable.
What am I doing wrong?
If a newable type value is an object constructor how do i pass the constructor function at runtime?