Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-select2-js-component

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-select2-js-component

select2 in angular4(>=2.0-release)

  • 1.1.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Angular-Select2-JS-Component

Angular-Select2-Component is based on these plugins and libs(version):

  • angular(>= 2.0-release)
  • jQuery
  • select2

How to use


Install

// npm install
npm install angular-select2-js-component --save

// if you have not installed jquery
npm install jquery --save

Use as component

  1. Import component.
// import NgModule
import {NgModule} from '@angular/core';
// import Select2Component
import {Select2Component} from 'angular-select2-js-component';

@NgModule({
  // ...
  // declare components
  declarations: [Select2Component]
})
export class YourModule {
}
  1. Template.
<select2 [options]="options" [settings]="{ setting: value }" [(ngModel)]="optionSelected" (onSelect)="onSelect($event)"></select2>

Options

  • options: option[]
    • select options for select2
    • option: {id: value, text: key} or string
  • ngModel: option value that is selected
    • id or string while multiple is disable
    • id[] or string[] while multiple is enable
  • onSelect
    • callback when option selected
    • parmas: option({id: value, text: key, selected: ifSelected} or string)
  • settings
    • configurable settings, see Select2 options API
    • setting: { settingOption: value, settingOption: value }

Keywords

FAQs

Package last updated on 03 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc