ng-simple-select
v1.0.6
Published
<div align="center">
Downloads
273
Readme
Description
ng-simple-select
This project is an example of how to set up and use the ng-select component with support for multiple selection, search, worker and virtual scrolling in Angular.
Table of Contents
Installing
Package manager
Using npm:
$ npm install ng-simple-select
1. Install necessary dependencies:
Dependencies and versions
"@angular/animations": "^17.3.11",
"@angular/cdk": "^17.3.10",
"@angular/common": "^17.1.0",
$ npm install @angular/[email protected] @angular/[email protected] @angular/[email protected]
import { SimpleSelectComponent, ngOptionComponent } from 'ng-simple-select';
Example
@Component({
standalone: true,
imports: [
SimpleSelectComponent,
ngOptionComponent,
FormsModule
]
})
export class Component {
filter: string[] = [];
options: string[] = ['1', '2', '3'];
}
<ng-select
AllowClear
[ShowSearch]="Boolean"
Mode="Isin['multiple', 'single']"
PlaceHolder="String"
(SearchChange)="EventEmitter"
(OpenChange)="EventEmitter"
NotFoundContent="String"
SearchPlaceHolder="String"
[(ngModel)]="filter"
>
@for (option of options; track option) {
<ng-option
[Label]="option"
[Value]="option">
{{ option }}
</ng-option>
}
</ng-select>