Skip to content

Commit

Permalink
Script loading issue
Browse files Browse the repository at this point in the history
The ad script'll only added when document loaded.
  • Loading branch information
peter-szrnka committed Nov 18, 2017
1 parent f546d00 commit 73ad190
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ng-adsense.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* ngAdsense AngularJS module for Google AdSense advertisements.
* @author Peter Szrnka (szrnka.peter@gmail.com)
* @version 1.2
* @version 1.4
*/
var ngAdSense = angular.module('ngAdsense', []);
ngAdSense.constant('SCRIPT_URL', '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js');
Expand Down Expand Up @@ -29,7 +29,7 @@ ngAdSense.controller('AdsenseController', ["SCRIPT_URL", "AdsenseTracker", funct
document.body.appendChild(s);
AdsenseTracker.isLoaded = true;
}
(window.adsbygoogle = window.adsbygoogle || []).push({});
angular.element(document).ready(function () {(window.adsbygoogle = window.adsbygoogle || []).push({})});
}]);
/**
* @directive adsenseDirective
Expand Down
3 changes: 1 addition & 2 deletions src/ng-adsense.min.js

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

0 comments on commit 73ad190

Please sign in to comment.