Disqus in Angular 2 application: Showing same discussion.

試著忘記壹切 提交于 2019-12-11 13:35:48

问题


I have Angular 2 app in there I use ng2-awesome-disqus component.

On the page I have several items and for each item I have one discussion component :

<disqus [shortname]="shortname" [identifier]="identifier"></disqus>
  • shortname is same for each item

  • identifier is unique for each item

I would expect unique discussion for each item, but there are all the same.


回答1:


By default, disqus only allows a single widget per page. I think (actually, I'm sure), your module can only deal with one disqus widget. Take a look at the code of the service.

You have to fork this project and manage multiple widget by yourself or create your own component that will do that if possible.

This question might help.




回答2:


For exam

<ng-container *ngFor="let item of items;let i=index">
   <disqus [shortname]="item.shortname" [identifier]="i"></disqus>
</ng-container>


来源:https://stackoverflow.com/questions/43095097/disqus-in-angular-2-application-showing-same-discussion

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!