ExceptionHandler update has been renamed to ErrorHandler stack overflow
orgiginal
This code
var injector = ReflectiveInjector.resolveAndCreate([...]);
creates a new independent injector that knows nothing about the services provided in your Angular applications.
You might want to introduce the injector used by Angular in your application, for example
class MyExceptionHandler extends ExceptionHandler { rbJSLogger: RBLoggerService; constructor(injector:Injector) { super(null,null); this.rbJSLogger = injector.get(RBLoggerService); } call(error, stackTrace = null, reason = null){ // console.error(stackTrace); this.rbJSLogger.searchBy("asd"); } }
or simply
class MyExceptionHandler extends ExceptionHandler { rbJSLogger: RBLoggerService; constructor(private rbJSLogger:RBLoggerService) { super(null,null); } call(error, stackTrace = null, reason = null){ // console.error(stackTrace); this.rbJSLogger.searchBy("asd"); } }
Günter Zöchbauer Jun 03 '16 at 8:42 on 2016-06-03 08:42
source share