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

ngconf-typeahead

v0.0.5

Published

Angular Library to provide Type ahead Feature to Angular apps.

Downloads

6

Readme

Ngconf-Typeahead Library

This project was generated with Angular CLI version 10.0.5.

ngconf-typeahead Typeahead Feature for Angular.

Demo Link

Stackblitz Demo

Step - 1

npm i ngconf-typeahead --save
NPM Package Link

Step - 2

npm i ngconf-search --save
NPM Package Link
Even ngconf-search package is maintained by us so that it is unlikely to have versioning issues.

import NgconfTypeaheadModule in app.module.ts file.
app.module.ts

import {NgconfTypeaheadModule} from 'ngconf-typeahead';
 imports: [
    NgconfTypeaheadModule
  ]

Step - 3

This step is to quick start the usage of package later with the understanding of workflow you can
modify the code.
app.component.ts

 term:any = "";
 stop:boolean = false;
 states:any = [
   'Adilabad',
   'Anantapur',
   'Chittoor',
   'Kakinada',
   'Guntur',
   'Hyderabad',
   'Karimnagar',
   'Khammam',
   'Krishna',
   'Kurnool',
   'Mahbubnagar',
   'Medak',
   'Nalgonda',
   'Nizamabad',
   'Ongole',
   'Hyderabad',
   'Srikakulam',
   'Nellore',
   'Visakhapatnam',
   'Vizianagaram',
   'Warangal',
   'Eluru',
   'Kadapa'
 ]

 onSelect(item){
   this.term = item;
 }

app.component.html

<input type="text" [(ngModel)]="term" placeholder="States">
<ngconf-typeahead
(onSelect)="onSelect($event)" 
[typeaheads] = "states" 
[term]="term"
[stop]="stop"
></ngconf-typeahead>

Explanation on Component Properties

1 (onSelect) event is triggered when user interact with the typeahead list showed.
2 [typeaheads] this input property is to take the data for typeahead preview filter.
3 [term] this input property is for binding user input to the filter.
4 [stop] this input property is for force stop typeahead functionality.

Styling of Typeahead Suggestions

(Styles can be overwritten based on your application theme)

Styles can be overwritten in global styles file in angular project.

  1. typeahead class is for parent div styling.
  2. typeaheadul class is for ul tag which is parent for li tag.
  3. typeaheadli class is for li elements of suggestions.

styles.css or styles.scss

.typeaheadul{
  background: #cce5ff;
}
.typeaheadli{
  color: purple;
}
.typeahead{
      box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
      padding: 10px;
}

That's it you are good to go. Happy Coding :)