Skip to content

Commit 47e4164

Browse files
authored
Merge pull request #216 from ngx-lib/viewchild-fix
Fix for Angular 9+ version
2 parents 70c5dfc + e9b7cbc commit 47e4164

File tree

121 files changed

+49669
-15488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+49669
-15488
lines changed

README.md

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
# Multiselect
44

5-
This project focuses on serving an intuitive select control. This look and feel of the component has been inspired by AngularJS [isteven-multiselect](http://isteven.github.io/angular-multi-select) directive, but from coding perspective, this may not be architectured in the similar way.
5+
This project focuses on serving an intuitive select control. This look and feel of the component has been inspired by AngularJS [isteven-multiselect](http://isteven.github.io/angular-multi-select) directive, but from coding perspective, this may not be architectured in the similar way.
66
It supports ultimate features like
7+
78
- 🖱️Virtual scroll
89
- 📃Forms
910
- 🎨Theming (bootstrap/material)
@@ -27,6 +28,7 @@ It's super easy to get started with Angular multiselect dropdown. Only three ste
2728
</code-example>
2829

2930
2. Import module `NgxMultiselectModule` into your `app.module.ts`
31+
3032
```js
3133
import { NgxMultiselectModule } from '@ngx-lib/multiselect';
3234

@@ -44,15 +46,10 @@ It's super easy to get started with Angular multiselect dropdown. Only three ste
4446
}
4547
```
4648

47-
48-
3. Use `ngx-multiselect` on HTML
49+
3) Use `ngx-multiselect` on HTML
4950

5051
```html
51-
<ngx-multiselect
52-
[(ngModel)]="selectedCountry"
53-
[options]="countries"
54-
ngDefaultControl>
55-
</ngx-multiselect>
52+
<ngx-multiselect [(ngModel)]="selectedCountry" [options]="countries" ngDefaultControl> </ngx-multiselect>
5653
```
5754

5855
```js
@@ -79,34 +76,53 @@ It's super easy to get started with Angular multiselect dropdown. Only three ste
7976
}
8077
```
8178

82-
## [**Stackblitz Demo**](https://stackblitz.com/edit/ngx-multilselect)
79+
## Version Support
80+
81+
| Angular Version | Supported version |
82+
| --------------- | ---------------------------- |
83+
| Angular 6 - 8 | @ngx-lib/multiselect - 1.x.x |
84+
| Angular 9+ | @ngx-lib/multiselect - 2.x.x |
85+
86+
## Playground
87+
88+
### Angular 6 - https://stackblitz.com/edit/angular-mo178b
8389

90+
### Angular 7 - https://stackblitz.com/edit/angular7-playground-duyksm
91+
92+
### Angular 8 - https://stackblitz.com/edit/ngx-multilselect
93+
94+
### Angular 9 - https://stackblitz.com/edit/angular-qfis38
95+
96+
### Angular 12 - https://stackblitz.com/edit/base-angular-12-app-cyixan
97+
98+
### Angular 13 - https://stackblitz.com/edit/angular-3qzfyc
99+
100+
### Angular 14 - https://stackblitz.com/edit/angular-rhm55j
84101

85102
# Developer tasks
86103

87104
We use `npm` to manage the dependencies and to run build tasks.
88105
You should run all these tasks from the `multiselect/docs_app` folder.
89106
Here are the most important tasks you might need to use:
90107

91-
* `npm install` - install all the dependencies.
92-
* `npm run setup` - install all the dependencies and run dgeni on the docs.
93-
94-
* `npm run build` - create a production build of the application (after installing dependencies, etc).
108+
- `npm install` - install all the dependencies.
109+
- `npm run setup` - install all the dependencies and run dgeni on the docs.
95110

96-
* `npm start` - run a development web server that watches the files; then builds the doc-viewer and reloads the page, as necessary.
97-
* `npm run serve-and-sync` - run both the `docs-watch` and `start` in the same console.
98-
* `npm run lint` - check that the doc-viewer code follows our style rules.
99-
* `npm test` - watch all the source files, for the doc-viewer, and run all the unit tests when any change.
100-
* `npm test -- --watch=false` - run all the unit tests once.
101-
* `npm run e2e` - run all the e2e tests for the doc-viewer.
111+
- `npm run build` - create a production build of the application (after installing dependencies, etc).
102112

103-
* `npm run docs` - generate all the docs from the source files.
104-
* `npm run docs-watch` - watch the multiselect source and the docs files and run a short-circuited doc-gen for the docs that changed (don't work properly at the moment).
105-
* `npm run docs-lint` - check that the doc gen code follows our style rules.
106-
* `npm run docs-test` - run the unit tests for the doc generation code.
113+
- `npm start` - run a development web server that watches the files; then builds the doc-viewer and reloads the page, as necessary.
114+
- `npm run serve-and-sync` - run both the `docs-watch` and `start` in the same console.
115+
- `npm run lint` - check that the doc-viewer code follows our style rules.
116+
- `npm test` - watch all the source files, for the doc-viewer, and run all the unit tests when any change.
117+
- `npm test -- --watch=false` - run all the unit tests once.
118+
- `npm run e2e` - run all the e2e tests for the doc-viewer.
107119

108-
* `npm run build-ie-polyfills` - generates a js file of polyfills that can be loaded in Internet Explorer.
120+
- `npm run docs` - generate all the docs from the source files.
121+
- `npm run docs-watch` - watch the multiselect source and the docs files and run a short-circuited doc-gen for the docs that changed (don't work properly at the moment).
122+
- `npm run docs-lint` - check that the doc gen code follows our style rules.
123+
- `npm run docs-test` - run the unit tests for the doc generation code.
109124
125+
- `npm run build-ie-polyfills` - generates a js file of polyfills that can be loaded in Internet Explorer.
110126
111127
# Running unit tests
112128
@@ -119,4 +135,4 @@ Here are the most important tasks you might need to use:
119135
1. `ng test --project='multiselect' --code-coverage`
120136
2. `npx http-server -c-1 -o -p 9875 ./coverage`
121137
122-
![alt text](https://raw.githubusercontent.com/ngx-lib/multiselect/master/code-coverage.png)
138+
![alt text](https://raw.githubusercontent.com/ngx-lib/multiselect/master/code-coverage.png)

angular.json

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,14 @@
1313
"build": {
1414
"builder": "@angular-devkit/build-angular:browser",
1515
"options": {
16+
"preserveSymlinks": true,
1617
"outputPath": "dist/ngx-multiselect",
1718
"index": "src/index.html",
1819
"main": "src/main.ts",
1920
"polyfills": "src/polyfills.ts",
2021
"tsConfig": "src/tsconfig.app.json",
21-
"assets": [
22-
"src/favicon.ico",
23-
"src/assets"
24-
],
25-
"styles": [
26-
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
27-
"src/styles.css"
28-
],
22+
"assets": ["src/favicon.ico", "src/assets"],
23+
"styles": ["./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css", "src/styles.css"],
2924
"scripts": []
3025
},
3126
"configurations": {
@@ -72,27 +67,16 @@
7267
"polyfills": "src/polyfills.ts",
7368
"tsConfig": "src/tsconfig.spec.json",
7469
"karmaConfig": "src/karma.conf.js",
75-
"styles": [
76-
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
77-
"src/styles.css"
78-
],
70+
"styles": ["./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css", "src/styles.css"],
7971
"scripts": [],
80-
"assets": [
81-
"src/favicon.ico",
82-
"src/assets"
83-
]
72+
"assets": ["src/favicon.ico", "src/assets"]
8473
}
8574
},
8675
"lint": {
8776
"builder": "@angular-devkit/build-angular:tslint",
8877
"options": {
89-
"tsConfig": [
90-
"src/tsconfig.app.json",
91-
"src/tsconfig.spec.json"
92-
],
93-
"exclude": [
94-
"**/node_modules/**"
95-
]
78+
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
79+
"exclude": ["**/node_modules/**"]
9680
}
9781
}
9882
}
@@ -117,9 +101,7 @@
117101
"builder": "@angular-devkit/build-angular:tslint",
118102
"options": {
119103
"tsConfig": "e2e/tsconfig.e2e.json",
120-
"exclude": [
121-
"**/node_modules/**"
122-
]
104+
"exclude": ["**/node_modules/**"]
123105
}
124106
}
125107
}
@@ -153,13 +135,8 @@
153135
"lint": {
154136
"builder": "@angular-devkit/build-angular:tslint",
155137
"options": {
156-
"tsConfig": [
157-
"projects/multiselect/tsconfig.lib.json",
158-
"projects/multiselect/tsconfig.spec.json"
159-
],
160-
"exclude": [
161-
"**/node_modules/**"
162-
]
138+
"tsConfig": ["projects/multiselect/tsconfig.lib.json", "projects/multiselect/tsconfig.spec.json"],
139+
"exclude": ["**/node_modules/**"]
163140
}
164141
}
165142
}
@@ -169,4 +146,4 @@
169146
"cli": {
170147
"analytics": "f38b24e8-f689-4fde-96cc-2821b4dea14a"
171148
}
172-
}
149+
}

docs_app/angular.json

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"build": {
1212
"builder": "@angular-devkit/build-angular:browser",
1313
"options": {
14+
"preserveSymlinks": true,
1415
"outputPath": "dist",
1516
"index": "src/index.html",
1617
"main": "src/main.ts",
@@ -35,9 +36,7 @@
3536
"output": "/assets/js"
3637
}
3738
],
38-
"styles": [
39-
"src/styles.scss"
40-
],
39+
"styles": ["src/styles.scss"],
4140
"scripts": []
4241
},
4342
"configurations": {
@@ -149,9 +148,7 @@
149148
"polyfills": "src/polyfills.ts",
150149
"tsConfig": "src/tsconfig.spec.json",
151150
"scripts": [],
152-
"styles": [
153-
"src/styles.scss"
154-
],
151+
"styles": ["src/styles.scss"],
155152
"assets": [
156153
"src/img",
157154
"src/assets",
@@ -175,10 +172,7 @@
175172
"lint": {
176173
"builder": "@angular-devkit/build-angular:tslint",
177174
"options": {
178-
"tsConfig": [
179-
"src/tsconfig.app.json",
180-
"src/tsconfig.spec.json"
181-
],
175+
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
182176
"exclude": []
183177
}
184178
}
@@ -199,9 +193,7 @@
199193
"lint": {
200194
"builder": "@angular-devkit/build-angular:tslint",
201195
"options": {
202-
"tsConfig": [
203-
"tests/e2e/tsconfig.e2e.json"
204-
],
196+
"tsConfig": ["tests/e2e/tsconfig.e2e.json"],
205197
"exclude": []
206198
}
207199
}

docs_app/content/examples/custom-template/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import { enableProdMode } from '@angular/core';
33
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
44

5-
import { AppModule } from './app/app.module';
6-
import { environment } from './environments/environment';
5+
import { AppModule } from '../../../../../src/app/app.module';
6+
import { environment } from '../../../../../src/environments/environment';
77

88
if (environment.production) {
99
enableProdMode();

docs_app/content/examples/enable-disable/src/app/enable-disable.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class EnableDisableComponent implements OnInit {
1111
selectedOptions;
1212
form: FormGroup;
1313

14-
constructor() {}
14+
constructor() { }
1515

1616
ngOnInit(): void {
1717
this.options = [{
@@ -52,23 +52,23 @@ export class EnableDisableComponent implements OnInit {
5252
this.form.controls['selectedOptions'].disable();
5353
}
5454

55-
disableFirstOption(){
55+
disableFirstOption() {
5656
let options = [...this.options]
5757
// disabled first element
5858
options[0].disabled = true;
5959
this.options = options;
6060
}
6161

62-
disableWholeGroup(){
62+
disableWholeGroup() {
6363
this.options = this.options.map((player) => {
64-
if(player.team === 'Manchester United') {
64+
if (player.team === 'Manchester United') {
6565
player.disabled = true;
6666
}
6767
return player;
6868
});
6969
}
7070

71-
enableWholeDropdown () {
71+
enableWholeDropdown() {
7272
this.options = this.options.map((player) => ({ ...player, disabled: false }));
7373
this.form.controls['selectedOptions'].enable();
7474
}

docs_app/content/examples/enable-disable/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import { enableProdMode } from '@angular/core';
33
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
44

5-
import { AppModule } from './app/app.module';
6-
import { environment } from './environments/environment';
5+
import { AppModule } from './../../../../src/app/app.module';
6+
import { environment } from './../../../../src/environments/environment';
77

88
if (environment.production) {
99
enableProdMode();

docs_app/content/examples/events/src/app/events.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class EventsDemoComponent implements OnInit {
88
options;
99
message: string;
1010

11-
constructor() {}
11+
constructor() { }
1212

1313
ngOnInit(): void {
1414
// Retrieving data for dropdown

docs_app/content/examples/events/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import { enableProdMode } from '@angular/core';
33
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
44

5-
import { AppModule } from './app/app.module';
6-
import { environment } from './environments/environment';
5+
import { AppModule } from './../../../../src/app/app.module';
6+
import { environment } from './../../../../src/environments/environment';
77

88
if (environment.production) {
99
enableProdMode();

docs_app/content/examples/grouping/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import { enableProdMode } from '@angular/core';
33
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
44

5-
import { AppModule } from './app/app.module';
6-
import { environment } from './environments/environment';
5+
import { AppModule } from './../../../../src/app/app.module';
6+
import { environment } from './../../../../src/environments/environment';
77

88
if (environment.production) {
99
enableProdMode();

docs_app/content/examples/model-driven/src/app/model-driven.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ export class ModelDrivenComponent implements OnInit {
1010
options;
1111
selectedOptions;
1212

13-
constructor() {}
13+
constructor() { }
1414

1515
ngOnInit(): void {
1616
this.options = [
1717
{ "id": 1, "name": "Manchester United" },
1818
{ "id": 2, "name": "Liverpool F.C." },
1919
{ "id": 3, "name": "Chelsea F.C." },
20-
{ "id": 4, "name": "Arsenal F.C." },
20+
{ "id": 4, "name": "Arsenal F.C." },
2121
{ "id": 5, "name": "FC Barcelona" }
2222
];
2323
this.selectedOptions = new FormControl([

docs_app/content/examples/model-driven/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import { enableProdMode } from '@angular/core';
33
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
44

5-
import { AppModule } from './app/app.module';
6-
import { environment } from './environments/environment';
5+
import { AppModule } from './../../../../src/app/app.module';
6+
import { environment } from './../../../../src/environments/environment';
77

88
if (environment.production) {
99
enableProdMode();

docs_app/content/examples/observable/src/app/observable-async.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class ObservableAsyncComponent implements OnInit {
1111
observableOptions;
1212
selectedOptions;
1313

14-
constructor() {}
14+
constructor() { }
1515

1616
ngOnInit(): void {
1717
this.selectedOptions = new FormControl([
@@ -21,7 +21,7 @@ export class ObservableAsyncComponent implements OnInit {
2121

2222
this.observableOptions = new Observable((observer) => {
2323
observer.next([
24-
{ "id": 1, "name": "Manchester United" },
24+
{ "id": 1, "name": "Manchester United" },
2525
{ "id": 2, "name": "Liverpool F.C." },
2626
{ "id": 3, "name": "Chelsea F.C." },
2727
{ "id": 4, "name": "Arsenal F.C." },

0 commit comments

Comments
 (0)