Tested with AngularJS 1.5.x and Chrome 48.
export class CustomLogService implements ng.ILogService{ constructor(private $delegate: ng.ILogService) { } public debug: ng.ILogCall = (...args: any[]): void => { this.$delegate.debug.apply(this, args); } public error: ng.ILogCall = (...args: any[]): void => { this.$delegate.error.apply(this, args); } public info: ng.ILogCall = (...args: any[]): void => { this.$delegate.info.apply(this, args); } public log: ng.ILogCall = (...args: any[]): void => { this.$delegate.log.apply(this, args); } public warn: ng.ILogCall = (...args: any[]): void => { this.$delegate.warn.apply(this, args); } } [...] app.config(["$provide", ($provide: ng.auto.IProvideService) => { $provide.decorator('$log', ["$delegate", ($delegate: ng.ILogService) => { return new CustomLogService($delegate); }]); }]); [...] |