A high-performance, standalone Angular pipe for dynamic, deep search filtering across nested objects and arrays. Supports case sensitivity and property exclusion.
npm install ngx-dynamic-search


ngx-dynamic-search is a high-performance, lightweight, and standalone Angular pipe designed for dynamic, deep search filtering across complex nested objects and arrays. It seamlessly integrates with modern Angular applications (Angular 14+), providing a robust solution for client-side filtering.
* 🔍 Deep Search: Recursively searches through nested objects and arrays to find matches anywhere in your data structure.
* ⚡ High Performance: Optimized for speed, ensuring smooth filtering even with large datasets.
* 🛡️ Type Safe: Gracefully handles null, undefined, Date objects, and various primitive types without crashing.
* 🧩 Standalone: Built as a standalone pipe, making it easy to import and use in any Angular component without NgModule boilerplate.
* ⚙️ Customizable: Supports case-sensitive search and the ability to exclude specific properties from the search scope.
Install the library via npm:
``bash`
npm install ngx-dynamic-search
Since ngxDynamicSearch is a standalone pipe, simply add it to the imports array of your standalone component.
`typescript
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { DynamicSearchPipe } from 'ngx-dynamic-search';
@Component({
selector: 'app-root',
standalone: true,
imports: [CommonModule, FormsModule, DynamicSearchPipe], // Import here
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
searchValue = '';
items = [
{
company: 'Alfreds Futterkiste',
contact: 'Maria Anders',
country: 'Germany',
details: { sector: 'Food', employees: 50 }
},
{
company: 'Centro comercial Moctezuma',
contact: 'Francisco Chang',
country: 'Mexico',
details: { sector: 'Retail', employees: 120 }
},
// ... more items
];
}
`
Apply the pipe to your *ngFor loop.
`html`
Company
Contact
Country
{{item.company}}
{{item.contact}}
{{item.country}}
| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| items | any[] | - | The array of objects to filter. |term
| | string | - | The search string to match against object properties. |isCaseSensitive
| | boolean | false | (Optional) If true, performs a case-sensitive search. |excludes
| | string[] | []` | (Optional) An array of property keys to ignore during the search. |
Contributions are welcome! Please feel free to submit a Pull Request or open an issue on GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.
---