diff --git a/coffee/profit-well.coffee b/coffee/profit-well.coffee index fe9d7e1..6c3dc29 100644 --- a/coffee/profit-well.coffee +++ b/coffee/profit-well.coffee @@ -27,7 +27,7 @@ template = """ (function(i,s,o,g,r,a,m){i['ProfitWellObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m); })(window,document,'script','https://dna8twue3dlxq.cloudfront.net/js/profitwell.js','profitwell'); profitwell('auth_token', '<%= token %>'); - profitwell('user_email', '<%= user.email %>'); + profitwell('user_email', '<%= email %>'); """ @@ -35,11 +35,10 @@ ProfitWellDirective = ($compile, $auth, $config) -> link = ($scope, $el, $attrs) -> context = { token: $config.get("profitWellToken"), - user: $auth.getUser() + email: $auth.getUser()?.email } profitWellScript = _.template(template)(context) - $el.append(profitWellScript) return { diff --git a/dist/profit-well.js b/dist/profit-well.js index d6e87c2..8f9da41 100644 --- a/dist/profit-well.js +++ b/dist/profit-well.js @@ -1 +1 @@ -(function(){var ProfitWellDirective,module,template;template="",ProfitWellDirective=function($compile,$auth,$config){var link;return link=function($scope,$el,$attrs){var context,profitWellScript;return context={token:$config.get("profitWellToken"),user:$auth.getUser()},profitWellScript=_.template(template)(context),$el.append(profitWellScript)},{restrict:"E",link:link}},module=angular.module("profitWellPlugin",[]),module.directive("body",["$compile","$tgAuth","$tgConfig",ProfitWellDirective])}).call(this); \ No newline at end of file +(function(){var ProfitWellDirective,module,template;template="",ProfitWellDirective=function($compile,$auth,$config){var link;return link=function($scope,$el,$attrs){var context,profitWellScript,ref;return context={token:$config.get("profitWellToken"),email:null!=(ref=$auth.getUser())?ref.email:void 0},profitWellScript=_.template(template)(context),$el.append(profitWellScript)},{restrict:"E",link:link}},module=angular.module("profitWellPlugin",[]),module.directive("body",["$compile","$tgAuth","$tgConfig",ProfitWellDirective])}).call(this); \ No newline at end of file