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

@bisual/ngx-index-template

v3.0.0

Published

Reactive index-page primitives for Angular 22

Downloads

572

Readme

@bisual/ngx-index-template

Reactive index-page primitives for Angular 22. The component keeps filters, pagination and sorting synchronized with the router query parameters.

Requirements

  • Angular 22
  • RxJS 7.8
  • Node.js 22.22.3+, 24.15.0+ or 26+

Usage

IndexTemplateComponent is standalone and can be imported directly. The NgxIndexTemplateModule export remains available for NgModule applications.

import { Component } from '@angular/core';
import { IndexTemplateComponent } from '@bisual/ngx-index-template';

@Component({
  selector: 'app-products',
  standalone: true,
  imports: [IndexTemplateComponent],
  template: `...`,
})
export class ProductsComponent extends IndexTemplateComponent {
  override fetchData(): void {
    // Refresh imperative or Observable-based data here.
  }
}

noFetchFields is a classic @Input() (string array). Bind it from the template when a query-param change should update the URL without calling fetchData():

<index-template-component [noFetchFields]="['panel']">
  ...
</index-template-component>

Sorting and laravel-shortcuts

Sort direction must live inside order_by (field:asc / field:desc). sortChange() writes that format. Do not send a separate order_by_direction query param — laravel-shortcuts would treat it as a column filter and can break the request.

// Prefer this in fetchData / API params:
order_by: 'created_at:desc'

// Or via the Material sort handler:
this.sortChange({ active: 'created_at', direction: 'desc' });
// → filterForm.order_by === 'created_at:desc'

Extending the component

Pass (router, fb, activatedRoute, utils) into super(...). Prefer bare constructor params or inject() rather than private router / private fb parameter properties — those conflict with the protected fields on the base class. protected override … is fine when you need to re-declare them.

Angular 22 httpResource

For GET requests, prefer httpResource in the concrete page. The library does not create an HTTP resource itself because only the consuming application knows the endpoint and response type. queryParameters is exposed as a signal so the resource reloads and cancels stale requests automatically.

import { httpResource } from '@angular/common/http';
import { Component } from '@angular/core';
import { IndexTemplateComponent } from '@bisual/ngx-index-template';

interface ProductPage {
  readonly data: readonly Product[];
  readonly total: number;
}

@Component({
  selector: 'app-products',
  standalone: true,
  template: `...`,
})
export class ProductsComponent extends IndexTemplateComponent {
  readonly products = httpResource<ProductPage>(
    () => ({
      url: '/api/products',
      params: this.queryParameters(),
    }),
    { defaultValue: { data: [], total: 0 } },
  );
}

Configure HttpClient in the consuming application when HTTP features such as interceptors or XSRF options are needed:

bootstrapApplication(AppComponent, {
  providers: [provideHttpClient()],
});

Use HttpClient directly for mutations such as POST, PUT, PATCH or DELETE.

Development

npm run build
npm test

The production package is generated in dist/ngx-index-template.