npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ngx-comentario

v0.6.0

Published

Library for embedding Comentario (https://comentario.app) comments into an Angular application

Downloads

4

Readme

ngx-comentario

ngx-comentario is a library that allows to easily embed comments served by Comentario into an existing Angular application.

Supported Comentario versions

This library supports all Comentario versions as of 3.0.0, although the support for properties may vary. See the property table below for details.

Installation

npm install --save ngx-comentario

Dependencies

ngx-comentario specifies the following components as peer dependencies, which means you have to have them installed for your application already (make sure they are listed under dependencies in your package.json):

  • @angular/core
  • @angular/common

Usage

Add the <ngx-comentario-comments> tag to your application at the point you want your comments to appear, for example:

<ngx-comentario-comments
    scriptUrl="https://comentario.example.com/comentario.js"></ngx-comentario-comments>

Attributes

The behaviour of Comentario and the appearance of the comments can be customised by setting additional attributes on the <ngx-comentario-comments> tag, described below.

All attributes are optional, however, if you don't provide scriptUrl, you'll have to add the required <script> element to your page (preferably to its <head> element) yourself.

| Attribute | Type | Description | |---------------|-------------------|--------------------------------------------------------------------------------------------------------------------| | scriptUrl | string | Complete URL of Comentario script. | | cssOverride | string \| false | URL of an additional CSS stylesheet to load, or false to disable styling altogether. | | maxLevel | number | Maximum visual comment nesting level (1 or more). (Comentario 3.1.0+) | | noFonts | boolean | If set to true, no standard fonts will be applied to the comments. | | pageId | string | Page ID, which maps to a real app path and starts with a /. If not provided, the current page path will be used. |

Single component for multiple routes

In a routed Angular application, it's quite often the case a single component serves multiple routes. This is typically achieved by adding route parameters to the config, for instance:

@NgModule({
    imports: [RouterModule.forRoot([
        {path: 'blog/post/:id', component: BlogPostComponent},
    ])],
    exports: [RouterModule],
})
export class AppRoutingModule {}

In this example, the BlogPostComponent will display a post with the given ID, obtained from the ActivatedRoute.

If you insert an <ngx-comentario-comments> into the BlogPostComponent's template, you'll also need to make sure the path it uses for comment display changes along with route changes.

The following example demonstrates how you can use a route parameter subscription to calculate a pageId, which is then bound to the same-named property in the template.

blog-post-component.html:


<!-- Post title -->
<h1>{{ post.title }}</h1>

<!-- Post text -->
<div>{{ post.text }}</div>

<!-- Comments -->
<h2>Comments</h2>

<!-- Hide any comments until there's a pageId -->
<ng-container *ngIf="pageId">
    <ngx-comentario-comments
        scriptUrl="https://comentario.example.com/comentario.js"
        [pageId]="pageId"></ngx-comentario-comments>
</ng-container>

blog-post-component.ts:

@Component({
    selector: 'app-blog-post',
    templateUrl: './blog-post-component.html',
})
export class BlogPostComponent {

    pageId?: string;

    constructor(route: ActivatedRoute) {
        route.paramMap.subscribe(pm => this.pageId = pm.has('id') ? `/blog/post/${pm.get('id')}` : undefined);
    }
}

See also the demo-app project for a slightly different approach that uses a Router subscription (because comments are rendered for child routes of the AppComponent).