Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
ccd8c57
ts-lint fixs
May 29, 2018
61baac6
angular 6 package
May 29, 2018
1dac792
add dist
May 29, 2018
6e8c131
test website
Jun 2, 2018
c599fa9
add angular 7 support
Oct 26, 2018
a0717fd
create npm release
icecoldfire Oct 29, 2018
5a84d98
fix bug placeholder
icecoldfire Jan 28, 2019
4b07029
support for angular 8
icecoldfire Jun 13, 2019
d83f08c
fix package.json
Jun 18, 2019
8662e18
Validate that `this.element` is defined before calling `.off()`.
Jul 25, 2019
c308f48
package version 1.1.2
Jul 26, 2019
0dc87af
add custom array collection #11
Aug 21, 2019
c8a0488
solve two way binding issue #12
Oct 19, 2019
da136dc
add support for disabled controls in reactive forms
sebastien-lamps Oct 24, 2019
07804b4
add support for disabled controls in reactive forms
sebastien-lamps Oct 24, 2019
5f35108
bump packages to v1.2.1
Oct 24, 2019
4e09517
set recommended angular options
Oct 24, 2019
0bf2d77
Update package.json
icecoldfire Oct 25, 2019
372d593
Update nodejs.yml
icecoldfire Oct 25, 2019
a9baa6d
Update nodejs.yml
icecoldfire Oct 25, 2019
1d05fd4
Update README.md
icecoldfire Oct 25, 2019
f9130b6
fix valueChanged #14
icecoldfire Nov 3, 2019
b983e10
update readme
icecoldfire Nov 3, 2019
bf3f954
Update README.md
icecoldfire Nov 14, 2019
457b8fc
add allow clear demo #18
icecoldfire Nov 16, 2019
f3b1f1a
update readme
icecoldfire Nov 16, 2019
d36f19a
Upgrade to latest angular v8
Oct 9, 2020
790188a
Upgrade to latest angular v9
Oct 9, 2020
83d852b
Upgrade to latest angular v9
Oct 9, 2020
3cf8bc6
Upgrade to latest angular v10
Oct 9, 2020
2c0bdc5
upgrade packages
Oct 9, 2020
59758bd
Bump package
Oct 9, 2020
6d346f1
Update README.md
icecoldfire Oct 9, 2020
b0fdd0f
Bump lodash from 4.17.15 to 4.17.20
dependabot[bot] Oct 9, 2020
407067b
Update ng-packagr
Nov 16, 2020
aefa07b
Update anuglar cli
Nov 16, 2020
f84bdb1
Update package version
Nov 16, 2020
3ec8b27
Add test for issue #30
Feb 3, 2021
86b8999
Add forms example #19
Feb 3, 2021
cbfedfc
bugfix null init value #30
Feb 8, 2021
0c5b2c5
Update to angular 12
Sep 9, 2021
09d30f5
Fix namespaces
Sep 9, 2021
16810e9
Bump node version
Sep 9, 2021
7668894
Fix package version #55
Sep 13, 2021
15621c8
Fixed casing in import statements.
IRCraziestTaxi Nov 1, 2021
7f4720f
Release import fixes #57 #58
Nov 2, 2021
3309614
Update to angular v13
Nov 5, 2021
a7ef0b9
bugfix data dropdown
Nov 5, 2021
00f769b
copy readme file to package folder
Nov 5, 2021
9ffbc9d
Update issue templates
icecoldfire Nov 20, 2021
b8dc85c
Update bug_report.md
icecoldfire Nov 20, 2021
8707439
Update feature_request.md
icecoldfire Nov 20, 2021
5328b7e
fix autofill #33
EpicVoyage Oct 29, 2021
a11337f
improvement: Added 2 more fields I needed [required, class].
EpicVoyage Nov 1, 2021
b7f9e95
bugfix: Prevent repetitive change events.
EpicVoyage Nov 1, 2021
b27d4ab
Create release 1.4.0
Jan 2, 2022
0a90b76
fix import
Jan 2, 2022
500179e
Update README.md
icecoldfire Jun 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
67 changes: 67 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅

Oh hi there! 😄

To expedite issue processing please search open and closed issues before submitting a new one.
Existing issues often contain information about workarounds, resolution, or progress updates.

Also check this is an issue for the ng-select2 wrapper, issues about select2 can be created at the [select2 repository](https://github.com/select2/select2).

🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->

# 🐞 Bug report

### Is this a regression?

<!-- Did this behavior use to work in the previous version? -->
<!-- ✍️--> Yes, the previous version in which this bug was not present was: ....

### Description

<!-- ✍️--> A clear and concise description of the problem...

## 🔬 Minimal Reproduction

<!--
Simple steps to reproduce this bug.

Please include: commands run (including args), packages added, related code changes.

If reproduction steps are not enough for reproduction of your issue, please create a minimal GitHub repository with the reproduction of the issue.
A good way to make a minimal reproduction is to create a new app via `ng new repro-app` and add the minimum possible code to show the problem.
Share the link to the repo below along with step-by-step instructions to reproduce the problem, as well as expected and actual behavior.

Issues that don't have enough info and can't be reproduced will be closed.

-->

## 🔥 Exception or Error

<pre><code>
<!-- If the issue is accompanied by an exception or an error, please share it below: -->
<!-- ✍️-->

</code></pre>

## 🌍 Your Environment

<pre><code>
<!-- run `ng version` and paste output below -->
<!-- ✍️-->

</code></pre>

**Anything else relevant?**

<!-- ✍️Is this a browser specific issue? If so, please specify the browser and version. -->

<!-- ✍️Do any of these matter: operating system, IDE, package manager, HTTP server, ...? If so, please mention it below. -->
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅

Oh hi there! 😄

To expedite issue processing please search open and closed issues before submitting a new one.
Existing issues often contain information about workarounds, resolution, or progress updates.

Also check this is an issue for the ng-select2 wrapper, issues about select2 can be created at the [select2 repository](https://github.com/select2/select2).

🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->

# 🚀 Feature request

### Description

<!-- ✍️--> A clear and concise description of the problem or missing capability...

### Describe the solution you'd like

<!-- ✍️--> If you have a solution in mind, please describe it.

### Describe alternatives you've considered

<!-- ✍️--> Have you considered any alternative solutions or workarounds?
27 changes: 27 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Node CI

on: [push]

jobs:
build:

name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version: [16.13.1]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install and build
run: |
npm install
npm run-script build-prod
env:
CI: true
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/tmp
/out-tsc
/dist-site
/dist

# dependencies
/node_modules
**/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db

projects/ng-select2/README.md
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"node_modules/": true,
},
"tslint.autoFixOnSave": true,
"html.format.wrapAttributes": "force-aligned",
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules\\typescript\\lib"
}
37 changes: 37 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "build-dev",
"problemMatcher": [
"$tsc"
]
},
{
"type": "npm",
"script": "lint",
"problemMatcher": [
"$tslint5"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "lint:fix",
"problemMatcher": [
"$tslint5"
]
},
{
"type": "npm",
"script": "copycontracts",
"problemMatcher": []
}
]
}
76 changes: 66 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Angular 4 wrapper component of jquery select2 (ng-select2)
# This package is archived and no longer maintained
You can use [@ng-select/ng-select](https://github.com/ng-select/ng-select) as replacement.

[![npm version](https://badge.fury.io/js/ng-select2.svg)](https://badge.fury.io/js/ng-select2) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)
<br><br><br><br><br><br><br><br><br><br>
# Angular 13 wrapper component of jquery select2 (ng-select2)

For Angular version 4.x.x and up. Forked from [ng2-select2](https://www.npmjs.com/package/ng2-select2). Supports two-way data-binding.
[![npm version](https://badge.fury.io/js/ng-select2.svg)](https://badge.fury.io/js/ng-select2) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Actions Status](https://github.com/tealpartners/ng-select2/workflows/Node%20CI/badge.svg)](https://github.com/tealpartners/ng-select2/actions)

For Angular version 8.x.x and up. Forked from [ng2-select2](https://www.npmjs.com/package/ng2-select2). Supports two-way data-binding.

## Prerequisites

Expand All @@ -18,21 +22,21 @@ Then install select2 using npm

`npm i -S select2`

Now include their scrpits and styles in your `angularcli.json` file
Now include their scrpits and styles in your `angular.json` file
```
"styles": [
"styles.css",
"../node_modules/select2/dist/css/select2.min.css"
"node_modules/select2/dist/css/select2.min.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"../node_modules/select2/dist/js/select2.min.js"
"node_modules/jquery/dist/jquery.js",
"node_modules/select2/dist/js/select2.min.js"
],
```

## Installation

Add package to your project `npm i -S ng-select2` (this will save package to your `dependencies` in `package.json`)
Add package to your project `npm i -s ng-select2` (this will save package to your `dependencies` in `package.json`)


## Basic implementation
Expand Down Expand Up @@ -71,10 +75,62 @@ import { NgSelect2Module } from 'ng-select2';
### Inputs
* **data** `Array<Select2OptionData>`: Data used for generating select2 - inferface definition
* **value** `string`: Default value for select2
* **dropdownParent** `string`: Allows you to [customize placement](https://select2.org/dropdown#dropdown-placement) of the dropdown.
* **width** `string`: Set width for the input, default value is `resolve`
* **disabled** `boolean`: Disable select2, default value is `false`
* **allowClear** `boolean`: Provides support for [clearable selections](https://select2.org/selections#clearable-selections), default value is `false`
* **placeholder** `string`: Placeholder for select2
* **options** `Select2Options`: Set options for select2, [all available options](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4869992bc079b88280b9ff91213528904109e8ae/select2/index.d.ts#L40) for select2
* **id** `string`: Set the id attribute
* **class** `string`: Set the class attribute
* **required** `boolean`: Set the required attribute
* **options** `Options`: Set options for select2, [all available options](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4869992bc079b88280b9ff91213528904109e8ae/select2/index.d.ts#L40) for select2

### Outputs
* **valueChanged** `string`: Emitted when value changes in select2 drop-down
* **valueChanged** `string | string[]`: Emitted when value changes in select2 drop-down

# Demos for Angular wrapper for Select2

You can view a live demo [here](https://tealpartners.github.io/ng-select2)

Every single demo is separate component. Bellow you can find links to components with descriptions.

#### [Demo](https://github.com/tealpartners/ng-select2/tree/master/src/app/demos/basic)
- basic demo with only data input
- disabled value in data array

#### [Demo](https://github.com/tealpartners/ng-select2/tree/master/src/app/demos/options) with options
- width option
- theme option
- multiple option
- closeOnSelect option

#### [Demo](https://github.com/tealpartners/ng-select2/tree/master/src/app/demos/template) with custom template demo
- custom template for drop down
- custom template for select2 input

#### [Demo](https://github.com/tealpartners/ng-select2/tree/master/src/app/demos/change) with data changing demo
- when you change value in drop down, new value is displayed on the screen
- you can change selected value
- you can change select2 data

#### [Demo](https://github.com/tealpartners/ng-select2/tree/master/src/app/demos/dynamic) with dynamic load demo
- data is loaded with 4 second delay
- selected value is loaded with 6 second delay

#### [Demo](https://github.com/tealpartners/ng-select2/tree/master/src/app/demos/multiple) with a multiple options
- multiple options
- default value
- tags

#### [Demo](https://github.com/tealpartners/ng-select2/tree/master/src/app/demos/value-changed) with value changed
- Demo with value changed output to console log


#### [Demo](https://github.com/tealpartners/ng-select2/tree/master/src/app/demos/allow-clear) with allow clear option
- Demo with allow clear option


#### [Demo](https://github.com/tealpartners/ng-select2/tree/master/src/app/demos/form) with a form
- Demo with a form

Demo forked from: https://github.com/NejcZdovc/ng2-select2-demo
Loading