-
-
Save alcance/d0e17bea7bc8dc6ac6ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myApp').directive('addthisToolbox', ['$timeout', function($timeout) { | |
return { | |
restrict : 'A', | |
transclude : true, | |
replace : true, | |
template : '<div ng-transclude></div>', | |
link : function($scope, element, attrs) { | |
$timeout(function () { | |
addthis.init(); | |
addthis.toolbox($(element).get(), {}, { | |
url: attrs.url, | |
title : "My Awesome Blog", | |
description : 'Checkout this awesome post on blog.me' | |
}); | |
}); | |
} | |
}; | |
}]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript"> | |
var addthis_config = {"data_track_addressbar":true}; | |
</script> | |
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid="></script> | |
</head> | |
<body> | |
<!-- html code --> | |
<div class="blog-posts" data-ng-repeat="post in posts"> | |
<!-- AddThis Button BEGIN --> | |
<div data-addthis-toolbox data-url="http://blog.me/{{post.link}}" id="bp-{{post.id}}" | |
class="addthis_toolbox addthis_default_style addthis_16x16_style"> | |
<a class="addthis_button_facebook"></a> | |
<a class="addthis_button_twitter"></a> | |
<a class="addthis_button_google_plusone_share"></a> | |
<a class="addthis_button_email"></a> | |
</div> | |
<!-- AddThis Button END --> | |
</div> | |
<!-- more html code --> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment