kirstein / angular-disqus Goto Github PK
View Code? Open in Web Editor NEWA set of directive(s) and services for disqus to simplify the life of developers.
Home Page: kirstein.github.com/angular-disqus
License: MIT License
A set of directive(s) and services for disqus to simplify the life of developers.
Home Page: kirstein.github.com/angular-disqus
License: MIT License
I tried using this and it doesn't seem to recognize $disqusProvider at all
Here is what I did:
bower install angular-disqus --save
added ngDisqus
tried to register the shortname.
(function(){
'use strict';
var dependencies = [
'ghpg',
'ngRoute',
'ngDisqus'
];
angular.module('blogger', dependencies)
.config(Config);
Config.$inject = ['$locationProvider', '$disqusProvider'];
function Config($locationProvider){
$locationProvider.hashPrefix('!');
$locationProvider.html5Mode('true');
$disqusProvider.setShortname('codeisdead');
}
if (window.location.hash === '#_=_'){
window.location.hash = '#!';
}
//bootstrap angular
angular.element(document).ready(function(){
angular.bootstrap(document, ['blogger']);
});
})();
Here is the error:
Failed to instantiate module blogger due to:
ReferenceError: $disqusProvider is not defined
at Config (http://127.0.0.1:8080/angular/app.js:19:3)
at Object.invoke (http://127.0.0.1:8080/js/lib/angular/angular.min.js:41:372)
at d (http://127.0.0.1:8080/js/lib/angular/angular.min.js:39:321)
at http://127.0.0.1:8080/js/lib/angular/angular.min.js:39:445
at q (http://127.0.0.1:8080/js/lib/angular/angular.min.js:7:355)
at g (http://127.0.0.1:8080/js/lib/angular/angular.min.js:39:222)
at bb (http://127.0.0.1:8080/js/lib/angular/angular.min.js:43:246)
at c (http://127.0.0.1:8080/js/lib/angular/angular.min.js:21:19)
at Object.yc [as bootstrap] (http://127.0.0.1:8080/js/lib/angular/angular.min.js:21:332)
at HTMLDocument.<anonymous> (http://127.0.0.1:8080/angular/app.js:32:11
I've been unable to get this working properly, and have tried to following the instructions as best I could, however they are a bit lacking. A full example would go a long way!
I have followed the steps like this:
1.) angular.module('myApp', [ โฆ, 'ngDisqus' ]);
2.) I could not get $disqusProvider.setShortname('shortname'); to work as I kept getting an exception stating that shortname is undefined, so used window.disqus_shortname
3.) I have tried to get my page_id into
without much luck.I have tried disqus="{{ page_id }}" and disqus="page_id" and every combination I can think of without any luck.
If I hardcode an id eg: 7, disqus loads, however if I use another id, eg: 8 and open a different page, it loads the same discussion.
I see there is a function function setGlobals(id, url, shortname), but I'm unable to call it. Is this needed?
This looks like a very handy bit of code, but I am highly confused about how to use it, I would appreciate any help!!
When you move from one post to another, like from test 1 page to test 2 page, with ngAnimate, I see that the plugin is not working properly.
It's a good plugin! :)
I use it for my blog, but I can't load disqus comment.
I debuged and I think it don't add the script tag to <head>
.
BTW, I manually added the <script src="http://go.disqus.com/embed.js"></script>
to <head>
and it load the disqus comment successfully, but the disqus comment is for http://moeloli.me
rather than http://moeloli.me/#!/article/xxxxxx
.
Thank you!
When i use angular-disqus on my SPA, and someone writes a comment, the comment's title is not set. It would be nice to be able to specify the title of the current "page" directly on the directive.
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}}")
It'd be great if this used a provider instead of window.shortname. This would allow the shortname to be defined within .config() in our applications to maintain good application structure.
Hi, is there a license you want to apply to the repo?
Hello! Can you help me to get comments count with this plugin?
Is this plugin has some method to help me with that?
Hi I would like to ask how to set 'per page' to limit the initial comments shown on load?
I'm trying to use this module on my examples page: http://bkuhl.github.io/ng-form-ui/#!/slide-toggle
I seem to be unable to get things working correctly but am also not seeing any errors. I've set everything up according to the "Getting Started" section.
Update: I had this problem prior to the v1.0 release
Is there any reason why the project is not in the bower registry ? =)
I'm trying to display the discussion after each article on the page. But it is shown only on the first article.
<main class="container container-last bg-transparent-white padding3">
<div class="row" ng-repeat="nomine in battleTatamiController.nomines" class="nomine-entry">
...
<div class="row">
<div class="col-xs-12">
<div disqus="photoshop-battle"></div>
</div>
</div>
</section>
</article>
<hr/>
</div>
</div>
</main>
I have followed README and added following on my page template
<div disqus="app._id"></div>
However, no matter which page I visit (with different app._id), I see the same Disqus thread. Is there a common cause of this problem?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.