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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tekdi/ngx-filter-search

v0.0.1

Published

- #### Install the package ` npm install ngx-filter-search` - #### Use package in your project - ##### After installing the library you need to import the library in your project.

Downloads

2

Readme

How to use the ngx-filter-search package

  • Install the package

npm install ngx-filter-search

  • Use package in your project

  • After installing the library you need to import the library in your project.
  1. Import Package in the module file

import { NgxFilterSearchModule } from 'ngx-filter-search';

  1. add the package in the import section.

imports: [ NgxFilterSearchModule ]

  • Create the configuration for the filter and search

    Create the configuration file or configuration variable , in configuration file create the json object. The example configuration file shown below, you can add filter you want by adding the values in the config.

export const filterConfig = {
    search: {
                isSearchShow: true,
                searchParameter: [
                   {
                       searchBy: 'Brand',
                   },
                   .
				   .
				   .
                ]
            },
    filter: {
        isShowFilter: true,
        // This Id is required, and used for finding the unique arrays.
        // Unique column (Ex . Auto increment Id)
        uniqueColumn: 'id',
        filterParameter:  [
            {   // FilterBy - It should be unique in the JSON and  node should contain in the data provided
                //(For checkboxes filter node should filterBy in data)
                filterBy: 'Brand',
                // isShowFilter - true for showing the filter.
                isShowFilter: true,
                // filterTitle - it is Name for the filter
                filterTitle: 'Brand',
                // fieldName - Name of the field we are showing after the checkbox.
                fieldName: 'Brand',
                //fieldValue - Field value is used for actual filtering the data
                fieldValue: 'Brand',
                // filterValuesSorting - Sorting the filter (All checkboxes is sorting)
                filterValuesSorting: true,
                //filterSortDirection - Direction of the sorting (ASC or DESC)
                filterSortDirection: 'asc',
                // filterType - Type of the filter (checkboxes or range_filter)
                filterType: 'checkBoxes',
                //filterCheckBoxLimit- Shows the minimum checkboxes at once....
                filterCheckBoxLimit: 10,
                //default the comparison is done with respect to the string datatype for, if needed we can pass the datatype as a Number
                //dataType: Number

            },
            {
                filterBy: 'Country',
                isShowFilter: true,
                filterTitle: 'Country',
                fieldName: 'Country',
                fieldValue: 'Country',
                filterValuesSorting: true,
                filterSortDirection: 'asc',
                filterType: 'checkBoxes',
                // dataType: Number,
                // Shows the minimum checkboxes at once....
                filterCheckBoxLimit: 10,
            },
           .
		   .
		   .
		   .
        ]
    },
  • Data format

{
    Brand: "MAMA"
    Country: "Myanmar"
    Stars: 5
    Style: "Pack"
    Top Ten: "2016 #10"
    Variety: "Instant Noodles Coconut Milk Flavour"
    id: 0
},
{
    Brand: "Prima Taste"
    Country: "Singapore"
    Stars: 5
    Style: "Nan"
    Top Ten: "2016 #1"
    Variety: "Singapore Laksa Wholegrain La Mian"
    id: 1
},
{
    Brand: "Prima"
    Country: "SG"
    Stars: "NaN"
    Style: "Pack"
    Top Ten: "2016 #8"
    Variety: "Juzz's Mee Creamy Chicken Flavour"
    id: 2
},
{
    Brand: "Prima Taste"
    Country: "Singapore"
    Stars: 5
    Style: "Pack"
    Top Ten: "2016 #5"
    Variety: "Singapore Curry Wholegrain La Mian"
    id: 3
},
{
    Brand: "Tseng Noodles"
    Country: "Taiwan"
    Stars: 5
    Style: "Pack"
    Top Ten: "2016 #9"
    Variety: "Scallion With Sichuan Pepper  Flavor"
    id: 4
},
{
    Brand: "Wugudaochang"
    Country: "China"
    Stars: 5
    Style: "Pack"
    Top Ten: "2016 #7"
    Variety: "Tomato Beef Brisket Flavor Purple Potato Noodle"
    id: 5
}
  • Add the code in the template file , to render the filter

<ngx-filter-search [config]="config" [data]="newRestaurants" (filteredData)="filterOutput($event)"><ngx-filter-search>

  • Add the function in the .ts file to get the filter data

filterOutput($event) { if ($event) { this.filteredData= $event; } }

Assign the $event to the any variable you want to shows in the template.