From 2b648c460a297b70bb2c36f5419366a763cb0c26 Mon Sep 17 00:00:00 2001 From: Irvin Thomas Date: Fri, 30 Sep 2016 15:36:20 +0200 Subject: [PATCH 1/3] Check if apiKey is defined --- src/angular-mixpanel.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/angular-mixpanel.js b/src/angular-mixpanel.js index fc62f20..b24e4eb 100644 --- a/src/angular-mixpanel.js +++ b/src/angular-mixpanel.js @@ -29,8 +29,10 @@ angular.module('analytics.mixpanel', []) if (!Object.prototype.hasOwnProperty.call(window, 'mixpanel')) { throw 'Global `mixpanel` not available. Did you forget to include the library on the page?'; } - - mixpanel.init(apiKey); + + if (apiKey !== undefined) { + mixpanel.init(apiKey); + } waitTillAsyncApiLoaded(function () { if (superProperties) mixpanel.register(superProperties); From d16ae8f3be747e66423f39639673db2808250039 Mon Sep 17 00:00:00 2001 From: Irvin Thomas Date: Mon, 3 Oct 2016 11:13:24 +0200 Subject: [PATCH 2/3] =?UTF-8?q?Correction=20d'une=20erreur=20JS=20si=20mix?= =?UTF-8?q?panel=20n'est=20pas=20d=C3=A9fini?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/angular-mixpanel.min.js | 2 +- src/angular-mixpanel.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/angular-mixpanel.min.js b/dist/angular-mixpanel.min.js index 72f246d..669e88b 100644 --- a/dist/angular-mixpanel.min.js +++ b/dist/angular-mixpanel.min.js @@ -1 +1 @@ -"use strict";angular.module("analytics.mixpanel",[]).provider("$mixpanel",function(){function a(){if(!Object.prototype.hasOwnProperty.call(window,"mixpanel"))throw"Global `mixpanel` not available. Did you forget to include the library on the page?";mixpanel.init(d),b(function(){e&&mixpanel.register(e)})}function b(a){Object.prototype.hasOwnProperty.call(window,"mixpanel")&&void 0!==window.mixpanel.__loaded||setTimeout(function(){b(a)},500),a()}function c(a){return function(){var b,c,d=window.mixpanel,e=a.split(".");for(c=0;c Date: Mon, 3 Oct 2016 11:15:57 +0200 Subject: [PATCH 3/3] Modification src/angular-mixpanel.js --- dist/angular-mixpanel.min.js | 2 +- src/angular-mixpanel.js | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/dist/angular-mixpanel.min.js b/dist/angular-mixpanel.min.js index 669e88b..7a8a3b9 100644 --- a/dist/angular-mixpanel.min.js +++ b/dist/angular-mixpanel.min.js @@ -1 +1 @@ -"use strict";angular.module("analytics.mixpanel",[]).provider("$mixpanel",function(){function a(){if(!Object.prototype.hasOwnProperty.call(window,"mixpanel"))throw"Global `mixpanel` not available. Did you forget to include the library on the page?";void 0!==d&&mixpanel.init(d),b(function(){e&&mixpanel.register(e)})}function b(a){Object.prototype.hasOwnProperty.call(window,"mixpanel")&&void 0!==window.mixpanel.__loaded||setTimeout(function(){b(a)},500),a()}function c(a){return function(){var b,c,d=window.mixpanel,e=a.split(".");for(c=0;c