I am not too sure how to access a function declared in an interface inside of my constructor. I have a simple inferface
export interface ILog {
extendLog($delegate: any): ng.ILogService;
}
and for my constructor
export class LogConfig implements ILog{
static $inject = ["$provide","$delegate"];
constructor(public $provide : ng.auto.IProvideService,
public $delegate: ng.ILogService
){
$provide.decorator('$log',extendLog );
}
extendLog($delegate: any): ng.ILogService {
var debugFunction = $delegate.debug;
$delegate.debug = (...args: any[]): void => {
var now = (new Date()).toLocaleTimeString();
args[0] = now + ' - ' + args[0];
debugFunction.apply(null, args);
};
return $delegate;
}
}
extendLog is giving and error though
Cannot find name 'extendLog'
Am i even going about this the right way? Just trying to create a simple decorator.
this.extendLog?