ngx disqus
v3.0.1
立即將DISQU添加到您的應用中!
npm i ngx-disqus
設置DISQUS Shortname,這是您網站的唯一標識符,如Disqus註冊
import { DISQUS_SHORTNAME } from 'ngx-disqus' ;
export const appConfig : ApplicationConfig = {
providers : [
{
provide : DISQUS_SHORTNAME ,
useValue : 'disqus_shortname'
} ,
]
}
現在您可以使用Disqus組件
import { DisqusModule } from 'ngx-disqus' ;
@ Component ( {
standalone : true ,
imports : [ DisqusModule ] ,
selector : 'single-post' ,
template : `<disqus [identifier]="pageId"></disqus>`
} )
export class SinglePostComponent {
pageId : string = '/post/123' ;
}
identifier
輸入才能在您的應用程序上正常工作localhost:4200/about
,則標識符應為/about
。這是一個stackblitz
在使用這些輸入之前,請參見DISQUS官方文檔(JavaScript配置變量)。
< disqus [ identifier ] = "pageId" [ url ] = "url" [ category ] = "catId" [ language ] = "'en'"
( newComment ) = "onComment($event)" ( ready ) = "onReady($event)" ( paginate ) = "onPaginate($event)" > < / disqus >
Hashlocationstaty與DISQU不兼容
有關更多信息,請查看Ajax網站上的Disqus
如果您確定此組件中的任何錯誤,或者有改進的想法,請打開問題!
穆哈夫·蘇斯利(Murhaf Sousli)