Home

Awesome

<p align="center"> <img height="150px" width="150px" style="text-align: center;" src="https://cdn.rawgit.com/MurhafSousli/ngx-disqus/55fb00f5/src/assets/logo.svg"> <h1 align="center">Angular Disqus Component</h1> </p>

Add Disqus to your app instantly!

npm Stackblitz npm npm bundle size (minified + gzip) npm

Installation

npm i ngx-disqus

Usage

Set the Disqus shortname which is the unique identifier for your website as registered on Disqus

import { DISQUS_SHORTNAME } from 'ngx-disqus';

export const appConfig: ApplicationConfig = {
  providers: [
    {
      provide: DISQUS_SHORTNAME,
      useValue: 'disqus_shortname'
    },
  ]
}

Now you can use the Disqus component

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';
}

Here is a stackblitz

More Options

See Disqus official documentation (JavaScript configuration variables) before using these inputs.

<disqus [identifier]="pageId" [url]="url" [category]="catId" [language]="'en'"
        (newComment)="onComment($event)" (ready)="onReady($event)" (paginate)="onPaginate($event)"></disqus>

NOTE

The HashLocationStrategy is not compatible with Disqus

For more info check DISQUS on ajax sites


Issues

If you identify any errors in this component, or have an idea for an improvement, please open an issue!

Author

Murhaf Sousli

More plugins