From b1d370697daa5f56093d258b3a48cfe64010427e Mon Sep 17 00:00:00 2001 From: Are Almaas Date: Tue, 14 Apr 2015 17:26:54 +0200 Subject: [PATCH] refactor to add module name for more flexibility --- qbaka-angular.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qbaka-angular.js b/qbaka-angular.js index 686ec19..d0d1cd8 100644 --- a/qbaka-angular.js +++ b/qbaka-angular.js @@ -38,9 +38,13 @@ window.qbaka.angular = function (module, apiKey) { trackEvents: true }; } + + // Argument can be string or an angular module + module = typeof module === 'string' ? angular.module(module):module) + module.factory('$exceptionHandler', function () { return function (exception) { qbaka.report(exception); }; }); -}; \ No newline at end of file +};