README
dropdown-select2
Install jQuery and Select2JS
Step 1. Query: http://jquery.com/
npm install jquery@1.11.1 --save
Step 2. https://select2.org/
Installation
To install this library, run:
$ npm install dropdown-select2 --save
Consuming your library
Once you have published your library to npm, you can import your library in any Angular application by running:
$ npm install dropdown-select2
and then from your Angular AppModule
:
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { DropdownSelect2Component, DropdownSelect2Module } from "dropdown-select2";
@NgModule({
imports: [
CommonModule,
DropdownSelect2Module
],
exports: [
DropdownSelect2Component
]
})
export class AppModule { }
Once your library is imported, you can use its components, directives and pipes in your Angular application:
Your template
<adpp-dropdown-select2 *ngIf="item.plan"
[keyField]="'id'"
[items]="pricePlans" [(model)]="item.plan.id"></adpp-dropdown-select2>
Development
To generate all *.js
, *.d.ts
and *.metadata.json
files:
$ npm run build
To lint all *.ts
files:
$ npm run lint
License
MIT © Dinh Hung Pham