我想在我的离子3进Web应用程序使用此NPM模块:https://www.npmjs.com/package/ngx-disqusNGX-disqus模块只显示一个线程
我把它导入到这样的page.module.ts:
import { DisqusModule } from 'ngx-disqus';
@NgModule({
declarations: [
SzenarioerstellungPage,
],
imports: [
IonicPageModule.forChild(SzenarioerstellungPage),
DisqusModule.forRoot('my_shortname'),
],
exports: [
SzenarioerstellungPage
]
})
export class SzenarioerstellungPageModule {}
这是我如何使用它的mypage.html文件:
<disqus [identifier] = "pageId" ></disqus>
这就是我如何设置pageId
:
ionViewDidLoad() {
this.szenarioProvider.getUserID().then(UID => {
this.pageId = UID;
});
}
正如你所看到的,我想使用的用户的唯一ID(这是他从拿到Firebase认证)在他的页面上显示一个独特的讨论线程。
现在的问题是,无论用户何时进入此页面,铁饼只会显示一个相同的线程,而不是每个用户的单独线程。
注:无论什么用户进入页面提到,它总是有相同的URL(离子确实是这样的。):http://localhost:8100/#/szenarioerstellung 但我想,这独特的[indentifier]将解决这个问题。
你知道吗,我做错了什么或者我需要添加什么?
[在角2应用Disqus。:显示相同的讨论]的可能的复制的要求部分(https://stackoverflow.com/questions/43095097/disqus-in-angular-2-application -showing-same-discussion) – n00dl3
我认为我的问题是另一个问题。我不想在我的页面上有多个disqus线程。我想要disqus加载属于进入页面的用户的唯一ID的线程。或者你的意思是,我不能解决我的问题,只有一个线程根据唯一的ID更改其内容? –
简短回答:ngx-disqus是非常无用的,可以构建你自己的disqus组件,并在需要时调用DISQUS.reset()方法:https://help.disqus.com/customer/portal/articles/472107-using-disqus -on-ajax-sites – n00dl3