in my experiment http://www.filepoodles.com/#/testadsenseA
I put adsense in vi-view and i click a button to redirect to another page with adsense . (press the button repeatly) during the four time redirect page, the adsense is show correctly, but next one redirect , the adsnse show empty. anybody know why? I guess that adsense's policy didn't allow to put more than 3 ad, (adsense make a misunderstanding that partial view is still one page ) Enrico Icardi於 2014年4月22日星期二 UTC+8下午10時56分45秒寫道: > > Thanks for that. the code works in my main.html, BUT > can you think of a reason why this shouldn't work in an ng-repeat or > inside a template? > > thanks, > enrico. > > > > > On Sunday, July 7, 2013 2:28:51 PM UTC+2, Pablo Ezequiel Leone Signetti > wrote: >> >> You should do a wrapper directive to the adSense script like this... >> >> <div data-my-ad-sense> >> <!-- Google AdSense --> >> <script async src=" >> http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> >> <ins class="adsbygoogle" >> style="display:inline-block;width:728px;height:90px" >> data-ad-client="ca-pub-0000000000" >> data-ad-slot="0000000000"></ins> >> <script> >> (adsbygoogle = window.adsbygoogle || []).push({}); >> </script> >> </div> >> >> And add this directive to your directives... >> >> directive('myAdSense', function() { >> return { >> restrict: 'A', >> transclude: true, >> replace: true, >> template: '<div ng-transclude></div>', >> link: function ($scope, element, attrs) {} >> } >> }) >> >> This is the adSense async code. >> > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
