ngx disqus
v3.0.1
เพิ่ม disqus ลงในแอพของคุณทันที!
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 >
hashlocationstrategy ไม่สามารถใช้งานได้กับ disqus
สำหรับข้อมูลเพิ่มเติมตรวจสอบ disqus บนไซต์ AJAX
หากคุณระบุข้อผิดพลาดใด ๆ ในองค์ประกอบนี้หรือมีแนวคิดสำหรับการปรับปรุงโปรดเปิดปัญหา!
Murhaf Sousli