An open API service indexing awesome lists of open source software.

https://github.com/margi47/ngx-paged-select

Select component for Angular 4 with scrolling and paging features. Sample project at https://margi47.github.io/ngx-paged-select/
https://github.com/margi47/ngx-paged-select

angular angular2 angular4 dropdown paging scrolling select typescript

Last synced: 10 months ago
JSON representation

Select component for Angular 4 with scrolling and paging features. Sample project at https://margi47.github.io/ngx-paged-select/

Awesome Lists containing this project

README

          

[![npm](https://img.shields.io/npm/v/ngx-paged-select.svg)](https://www.npmjs.com/package/ngx-paged-select)
[![npm](https://img.shields.io/npm/dt/ngx-paged-select.svg)](https://www.npmjs.com/package/ngx-paged-select)
[![Travis](https://img.shields.io/travis/Margi47/ngx-paged-select.svg)](https://travis-ci.org/Margi47/ngx-paged-select)
![npm](https://img.shields.io/npm/l/ngx-paged-select.svg)

# ngx-paged-select
A simple select component for Angular 4 with scrolling and paging features.

## Installation

To install this library, run:

```bash
$ npm install ngx-paged-select --save
```
## Prerequisites

You will need [ngx-infinite-scroll](https://github.com/orizens/ngx-infinite-scroll)

```bash
$ npm install ngx-infinite-scroll --save
```
and [Bootstrap](https://getbootstrap.com/) styles

```bash
$ npm install bootstrap --save
```
```html

```

## Consuming library

You can import library in any Angular application by running:

```bash
$ npm install ngx-paged-select
```

and then from your Angular `AppModule`:

```typescript
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import library
import { SelectModule } from 'ngx-paged-select';

@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,

// Specify library as an import
SelectModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
```

Once library is imported, you can use it in your Angular application:

```xml

```

```xml










```

## Supported API

### Properties
- options: array - Array of options to select from. If an array consists of complex objects, key property is needed.
- hasMoreOptions: boolean - Set to true, if current page is not the last one.
- key: string - (optional in case of simple types) - Indicates a property of a complex object, that needs to be displayed.
- placeholder: string - (default: "Select") - Text to display, when no element chosen.
- showNum: number - (default: length of first page) - Number of options visible in select window.
- multiple: boolean - (default: false) - Allows to select multiple options.

### Events
- loadData - Fires when new page needed or search input occured. Returns object with **page:number** and **filter:string** properties.
- optionSelected - Fires when option has been selected. Returns the entire option object or an array of option objects in case of *multiple* attribute set to true.

## Development

To generate all `*.js`, `*.d.ts` and `*.metadata.json` files:

```bash
$ npm run build
```

To lint all `*.ts` files:

```bash
$ npm run lint
```

To run example:

```bash
$ npm run playground
```

## License

MIT © [Margarita Liapustina](mailto:Margi47@users.noreply.github.com)