I've been following this coding example but I'm running into issues when trying to compile it. Any suggestions on how to troubleshoot this error?
import { Component } from '@angular/core';
function log(className)
{
console.log(className)
return (...args) => {
console.log("Arguments passed to this class's constructor are ", args)
return new className(...args)
}
}
@log
class myExampleClass
{
constructor(arg1, arg2)
{
console.log("Constructor fired!")
}
}
const myClass = new myExampleClass(5,10)
The specific error message I'm receiving states:
Unable to resolve signature of class decorator when called as an expression.
Type '(...args: any[]) => any' is not assignable to type 'typeof myExampleClass'.
Type '(...args: any[]) => any' provides no match for the signature 'new (arg1: any, arg2: any): myExampleClass'.