Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ng2-nested-search
Advanced tools
A simple custom pipe for filtering arrays in your angular(2+) projects and get the count of filtered items.
A simple custom pipe for filtering arrays in your Angular 2 projects (works with Angular 4 and Angular 5 too) and get the count of filtered items. It supports nested search and you may search the array of items on specific properties.
import { NgModule } from '@angular/core';
import { ViewCharacters } from './view-characters';
import { FilterPipeModule } from 'ng2-nested-search';
@NgModule({
declarations: [
ViewCharacters
],
imports: [
FilterPipeModule
],
})
export class ViewCharactersModule {}
searchName : string = "";
searchFamily : string = "";
filterMetadata = { count: 0, isNestedSearch : true };
characters = [
{
name : "Daenerys",
family : "Targaryen",
gender : "Female"
},
{
name : "Jaime",
family : "Lannister",
gender : "Male"
},
{
name : "Sansa",
family : "Stark",
gender : "Female"
},
{
name : "Arya",
family : "Stark",
gender : "Female"
},
{
name : "Theon",
family : "Greyjoy",
gender : "Male"
}
]
<div style="text-align: center;">
<div style="display : inline-block; width : 48%">
<input style="width: 100%; padding: 13px; border-radius: 4px; border: 1px solid #ccc;" placeholder="Search By Family" [(ngModel)]="searchFamily"/>
</div>
<div style="display : inline-block; width : 48%">
<input style="width: 100%; padding: 13px; border-radius: 4px; border: 1px solid #ccc;" placeholder="Search By Name" [(ngModel)]="searchName"/>
</div>
</div>
<div style="padding : 8px 4px 0px 4px;">
<span>Total items filtered : </span>
<span [innerHTML]="filterMetadata.count"></span>
</div>
<div class="ttct-request" style="border: 1px solid #ccc;padding: 8px;margin: 8px;border-radius: 4px;" *ngFor="let character of characters | ng2NestedSearch: { 'name' : searchName, 'family' : searchFamily} : filterMetadata">
<div>
<span style="color: #888;">Name : </span>
<span [innerHTML]="character.name"></span>
</div>
<div>
<span style="color: #888;">Family : </span>
<span [innerHTML]="character.family"></span>
</div>
<div>
<span style="color: #888;">Gender : </span>
<span [innerHTML]="character.gender"></span>
</div>
</div>
searchText : string = "";
filterMetadata = { count: 0 };
<div style="text-align: center;">
<div style="display : inline-block; width : 100%">
<input style="width: 100%; padding: 13px; border-radius: 4px; border: 1px solid #ccc;" placeholder="Search" [(ngModel)]="searchText"/>
</div>
</div>
<div style="padding : 8px 4px 0px 4px;">
<span>Total items filtered : </span>
<span [innerHTML]="filterMetadata.count"></span>
</div>
<div class="ttct-request" style="border: 1px solid #ccc;padding: 8px;margin: 8px;border-radius: 4px;" *ngFor="let character of characters | ng2NestedSearch: { 'name' : searchText, 'family' : searchText} : filterMetadata">
<div>
<span style="color: #888;">Name : </span>
<span [innerHTML]="character.name"></span>
</div>
<div>
<span style="color: #888;">Family : </span>
<span [innerHTML]="character.family"></span>
</div>
<div>
<span style="color: #888;">Gender : </span>
<span [innerHTML]="character.gender"></span>
</div>
</div>
gmail : melwin.vincent.90@gmail.com
FAQs
A simple custom pipe for filtering arrays in your angular(2+) projects and get the count of filtered items.
We found that ng2-nested-search demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.