Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions dist/angular-piwik.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions lib/angular-piwik.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,18 @@ mod.directive 'ngpPiwik', [
else
call.push param for param in attr_val.split(',')
return call

dir_def_obj =
restrict: 'E'
replace: no
transclude: yes
compile: (tElement, tAttrs, transclude) ->
script_elem = $document[0].createElement 'script'
script_elem.setAttribute 'src', tAttrs.ngpSetJsUrl
$document[0].body.appendChild script_elem

return {
pre: (scope, elem, attrs) ->
script_elem = $document[0].createElement 'script'
script_elem.setAttribute 'src', attrs.ngpSetJsUrl
$document[0].body.appendChild script_elem

post: (scope, elem, attrs) ->
for own k,v of attrs when /^ngp/.test(k)
do (k,v) ->
Expand Down