0

I've created this directive for addthis plugin but it only displays/renders the buttons once in a while, not everytime...

.directive('addThis', function(){
return {
    restrict: 'A',
    scope: {
        image: '='
    },
    replace: true,

    templateUrl: Directory.url + '/templates/_addthis.html',
    link: function(scope, elm){
        console.log('Create addthis button');
    }   
}

})

template code:

<ul class="image-actions">
<li><a class="addthis_button_facebook" addthis:url="{{image.link}}" fb:like:href="{{image.link}}"  addthis:title="{{image.post.post_title}}"></a></li>
<li><a class="addthis_button_twitter" tw:url="{{image.link}}"  addthis:title="{{image.post.post_title}}"></a></li>
<li><a class="addthis_button_pinterest_share" addthis:url="{{image.link}}"  addthis:title="{{image.post.post_title}}"></a></li>
<li><a class="addthis_button_google_plusone_share" addthis:url="{{image.link}}"  addthis:title="{{image.post.post_title}}"></a></li>
<li>
    <a class="addthis_button_compact" addthis:url="{{image.link}}"  addthis:title="{{image.post.post_title}}"></a>
    <a class="addthis_counter addthis_bubble_style" addthis:url="{{image.link}}"  addthis:title="{{image.post.post_title}}"></a>
</li>

Grateful for help... i'd like to be able to control when it renders... or somehow inject it into the scope...?

IamLasse
  • 123
  • 1
  • 11
  • Look at the firebug console. Is there any error. Is the content generated at all? – Chandermani Jul 29 '13 at 08:03
  • it gets generated sometimes, but doesnt ttrigger any error when it doesnt work.. – IamLasse Jul 29 '13 at 18:36
  • its mainly when i use angular router navigation that it doesnt get rendered – IamLasse Jul 29 '13 at 18:38
  • possible duplicate of [AngularJs and AddThis social plugin](http://stackoverflow.com/questions/15593039/angularjs-and-addthis-social-plugin) – towr Jan 01 '14 at 18:54
  • The other poster is not really doing anything dynamic, but merely including the addthis code in a directive, i want the directive to create the buttons, for more control... – IamLasse Aug 26 '14 at 19:26

0 Answers0