angular-disqus icon indicating copy to clipboard operation
angular-disqus copied to clipboard

Comment count

Open Anonyfox opened this issue 11 years ago • 3 comments

When I try the snippet from the README (with my settings of course) to show the comment count, I get the following javascript error:

Uncaught TypeError: Cannot call method 'appendChild' of null

in embed.js: 1.

This may be a disqus issue, but i simply don't know. Does it matter that I use the following (Jade) in a ng-repeat DIV?

a.title(ng-href="#!/news/{{item.id}}") {{item.title}}
a.label(ng-href="#!/news/{{item.id}}", data-disqus-identifier="{{item.id}}")  

Anonyfox avatar Dec 17 '13 11:12 Anonyfox

I encountered the same issue. With disqus directive, not only the data-disqus-identifier, it can be fixed.

a.label(ng-href="#!/news/{{item.id}}", disqus, data-disqus-identifier="{{item.id}}")  

truongminh avatar May 30 '14 04:05 truongminh

i found an issue in the disqusIdentifier directive. looks like when comment counts are loaded, the directive is trying to load the embed.js script as well. this is not needed for counts, so it can be safely removed.

function loadCount(id) { setGlobals(id, $location.absUrl(), shortname); //addScriptTag(getShortname(), TYPE_EMBED); <--REMOVE THIS LINE addScriptTag(getShortname(), TYPE_COUNT); getCount(); }

cdriscol avatar Aug 29 '14 01:08 cdriscol

just submitted a pull request with the fix, please review

cdriscol avatar Aug 29 '14 02:08 cdriscol