All Projects → umens → ngx-magicsearch

umens / ngx-magicsearch

Licence: MIT License
Magic Search/Faceted Search Library for Angular 2

Programming Languages

typescript
32286 projects
HTML
75241 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ngx-magicsearch

ng-data-picker
🏄🏼 A data picker based on Angular 4+ (like native datetime picker of iOS)
Stars: ✭ 24 (+26.32%)
Mutual labels:  angular2, ng2
angular-progress-http
[DEPRECATED] Use @angular/common/http instead
Stars: ✭ 43 (+126.32%)
Mutual labels:  angular2, ng2
ic-datepicker
Angular (2+) datepicker component
Stars: ✭ 27 (+42.11%)
Mutual labels:  angular2, ng2
Truly Ui
Truly-UI - Web Angular UI Components for Desktop Applications (Electron, NW, APP JS)
Stars: ✭ 195 (+926.32%)
Mutual labels:  angular2, ng2
ng-seed
Simple Angular seed project with commonly used features.
Stars: ✭ 12 (-36.84%)
Mutual labels:  angular2, ng2
angular2-signature-pad
Signature pad component for Angular 2.x and above.
Stars: ✭ 17 (-10.53%)
Mutual labels:  angular2, ng2
ng2-storage
A local and session storage wrapper for angular 2.
Stars: ✭ 14 (-26.32%)
Mutual labels:  angular2, ng2
Ngx Date Fns
⏳ date-fns pipes for Angular 2.0 and above ⏳
Stars: ✭ 135 (+610.53%)
Mutual labels:  angular2, ng2
ng2-STOMP-Over-WebSocket
STOMP Over WebSocket service for angular2
Stars: ✭ 35 (+84.21%)
Mutual labels:  angular2, ng2
ng-leaflet
Angular 2 component for Leaflet 1.x (WIP - Help Wanted)
Stars: ✭ 16 (-15.79%)
Mutual labels:  angular2, ng2
Ng2 Nouislider
Angular2 noUiSlider directive
Stars: ✭ 181 (+852.63%)
Mutual labels:  angular2, ng2
ng2-gravatar
Angular2 gravatar directive
Stars: ✭ 21 (+10.53%)
Mutual labels:  angular2, ng2
Angular Google Maps
Angular 2+ Google Maps Components
Stars: ✭ 1,982 (+10331.58%)
Mutual labels:  angular2, ng2
angular2-cookie-law
Angular2+ component that provides a banner to inform users about cookie law
Stars: ✭ 38 (+100%)
Mutual labels:  angular2, ng2
Ng2 Search Filter
Angular 2 / Angular 4 / Angular 5 custom pipe npm module to make a search filter on any input, 🔥 100K+ downloads
Stars: ✭ 137 (+621.05%)
Mutual labels:  angular2, ng2
ng2-fontawesome
An easy-to-use directive for font awesome icons.
Stars: ✭ 20 (+5.26%)
Mutual labels:  angular2, ng2
Ng2 Konva
Angular & Canvas - JavaScript library for drawing complex canvas graphics using Angular.
Stars: ✭ 78 (+310.53%)
Mutual labels:  angular2, ng2
Ng2 Smart Table
Angular Smart Data Table component
Stars: ✭ 1,590 (+8268.42%)
Mutual labels:  angular2, ng2
awesome-angular
💖 A list of awesome Angular (2️⃣➕) resources
Stars: ✭ 61 (+221.05%)
Mutual labels:  angular2, ng2
ng-elm
Write Angular components in Elm.
Stars: ✭ 41 (+115.79%)
Mutual labels:  angular2, ng2

ngx-magicsearch MIT license

Branch Build Status Dependency Status devDependency Status Version
Master Build Status Dependency Status devDependency Status 2.2.0
Develop Build Status Dependency Status devDependency Status -

Magic Search/Faceted Search Library for Angular 2 project

  • use v1* for angular 2
  • use v2.* for angular 4

Example

Getting Started

Use v1 for angular 2 v2 and v2 for angular 2 v4

These instructions are here to set up the library in your project.

See Contributing for instructions that will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Installing

You can install ngx-magicsearch by using npm.

npm install ngx-magicsearch --save

or

yarn add ngx-magicsearch

Add NgxMagicSearchModule to your module, eg.

import { NgxMagicSearchModule } from 'ngx-magicsearch';

@NgModule({
  imports: [ NgxMagicSearchModule ]
  // ...
})
export class AppModule {
}

Docs

And you can use selector ngx-magic-search in your template. HTML

<ngx-magic-search [strings]="lang" [facets_param]="choices" (textSearchEvent)="textSearch($event)" (searchUpdatedEvent)="searchUpdated($event)"></ngx-magic-search>

Plugin options

[facets_param] - object
Array<{name: string, label: string, options: Array<{key: string, label: string}>}>

Array of your filters - see example below

[strings] - object - optionnal
{remove: string, cancel: string, prompt: string, text: string}

Default value :

  • remove : 'Remove facet'
  • cancel : 'Clear search'
  • prompt: 'Select facets or enter text'
  • 'text': 'Text'

For Internationalization(i18n) purpose.

(searchUpdatedEvent) - Event

Event fire when user select a new search term. Return an array of type

Array<{key: string, values: Array<string>}>

Where

  • key = facets_param.name
  • value = facets_param.options.key
(textSearchEvent) - Event

Event fire when user make a search with a text. Return a string

Usage/Example

JavaScript

choices = [
  {
    'name': 'owner_alias',
    'label': 'Images owned by',
    'options': [
      {'key': '', 'label': 'Anyone'},
      {'key': 'self', 'label': 'Me (or shared with me)'}
    ]
  },
  {
    'name': 'platform',
    'label': 'Platform',
    'options': [
      {'key': 'linux', 'label': 'Linux'},
      {'key': 'windows', 'label': 'Windows'}
    ]
  },
  {
    'name': 'architecture',
    'label': 'Architecture',
    'options': [
      {'key': 'x86_64', 'label': '64-bit'},
      {'key': 'i386', 'label': '32-bit'}
    ],
  }
];

searchUpdated(terms) {
	console.log(terms);
};

textSearch(customTerm) {
	console.log(customTerm);
};

And

<ngx-magic-search [facets_param]="choices" (textSearchEvent)="textSearch($event)" (searchUpdatedEvent)="searchUpdated($event)"></ngx-magic-search>

See image above to see the result.

Running the tests

tests

tests are comming !

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

We use SemVer for versioning. For the versions available, see the tags on this repository.

We use Gitflow for the flow.

Authors

  • Ulysse Mensa - Initial work - github

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].