[英]ngx-disqus module in ionic v3 only displays one thread
我想在我的Ionic 3 Progressive Web應用程序中使用此npm-module: https : //www.npmjs.com/package/ngx-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(ionic就是這樣。): http:// localhost:8100 /#/ szenarioerstellung但是我認為,唯一的[indentifier]可以解決此問題問題。
你知道嗎,我做錯了什么,或者我需要補充/記住什么?
在路由器中使用#
時, DISQUS不起作用。
例如,URL http://localhost:8100/#/szenarioerstellung
讀為http://localhost:8100/
,因此,無論URL如何更改,在DISQUS端看起來還是一樣。
有兩種解決方案:
1-找到一種配置路由器以使用hashbang #!
代替#
2-從路由器禁用HashLocationStrategy
,使其像標准URL http://localhost:8100/szenarioerstellung
。
閱讀AJAX網站上的使用Disqus中的要求部分
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.