Skip to content

Commit 6678353

Browse files
authored
Add files via upload
1 parent ef2a702 commit 6678353

29 files changed

+762
-2
lines changed

README.md

+36-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
1-
# ej2-angular-7-multiselct-dropdown
2-
A quick start project that helps you to create an Angular 7 MultiSelect Dropdown with minimal code configuration.
1+
# Syncfusion Angular 7 MultiSelect Dropdown Quick Start Project
2+
3+
A quick start project that helps you to create the Syncfusion Angular 7 MultiSelect Dropdown with minimal code configuration.
4+
5+
![Angular 7 MultiSelect Dropdown](multiselect-dropdown.png)
6+
7+
## MultiSelect Dropdown features covered in this Project
8+
9+
This is an Angular 7 project created using [Angular CLI](https://github.com/angular/angular-cli) 7.0.4. The MultiSelect Dropdown features included in this project are as follows.
10+
* Angular 7 MultiSelect Dropdown initialization.
11+
* Data binding to the MultiSelect Dropdown.
12+
* Setting the value on initial rendering.
13+
* Getting the value on button submit action.
14+
15+
## How to run this application?
16+
To run this application, you need to first clone the `ej2-angular-7-multiselct-dropdown` repository and then navigate to its appropriate path where it has been located in your system.
17+
18+
To do so, open the command prompt and run the below commands one after the other.
19+
20+
```
21+
git clone https://github.com/SyncfusionSamples/ej2-angular-7-multiselct-dropdown.git
22+
cd ej2-angular-7-multiselct-dropdown
23+
```
24+
25+
## Installing
26+
Once done with downloading, next you need to install the necessary packages required to run this application locally. The `npm install` command will install all the needed angular packages into your current project and to do so, run the below command.
27+
28+
```
29+
npm install
30+
```
31+
## Running on development server
32+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
33+
34+
## Further help
35+
36+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

angular.json

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"ej2-angular7-multiselect": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"prefix": "app",
11+
"schematics": {},
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:browser",
15+
"options": {
16+
"outputPath": "dist/ej2-angular7-multiselect",
17+
"index": "src/index.html",
18+
"main": "src/main.ts",
19+
"polyfills": "src/polyfills.ts",
20+
"tsConfig": "src/tsconfig.app.json",
21+
"assets": [
22+
"src/favicon.ico",
23+
"src/assets"
24+
],
25+
"styles": [
26+
"src/styles.css"
27+
],
28+
"scripts": []
29+
},
30+
"configurations": {
31+
"production": {
32+
"fileReplacements": [
33+
{
34+
"replace": "src/environments/environment.ts",
35+
"with": "src/environments/environment.prod.ts"
36+
}
37+
],
38+
"optimization": true,
39+
"outputHashing": "all",
40+
"sourceMap": false,
41+
"extractCss": true,
42+
"namedChunks": false,
43+
"aot": true,
44+
"extractLicenses": true,
45+
"vendorChunk": false,
46+
"buildOptimizer": true,
47+
"budgets": [
48+
{
49+
"type": "initial",
50+
"maximumWarning": "2mb",
51+
"maximumError": "5mb"
52+
}
53+
]
54+
}
55+
}
56+
},
57+
"serve": {
58+
"builder": "@angular-devkit/build-angular:dev-server",
59+
"options": {
60+
"browserTarget": "ej2-angular7-multiselect:build"
61+
},
62+
"configurations": {
63+
"production": {
64+
"browserTarget": "ej2-angular7-multiselect:build:production"
65+
}
66+
}
67+
},
68+
"extract-i18n": {
69+
"builder": "@angular-devkit/build-angular:extract-i18n",
70+
"options": {
71+
"browserTarget": "ej2-angular7-multiselect:build"
72+
}
73+
},
74+
"test": {
75+
"builder": "@angular-devkit/build-angular:karma",
76+
"options": {
77+
"main": "src/test.ts",
78+
"polyfills": "src/polyfills.ts",
79+
"tsConfig": "src/tsconfig.spec.json",
80+
"karmaConfig": "src/karma.conf.js",
81+
"styles": [
82+
"src/styles.css"
83+
],
84+
"scripts": [],
85+
"assets": [
86+
"src/favicon.ico",
87+
"src/assets"
88+
]
89+
}
90+
},
91+
"lint": {
92+
"builder": "@angular-devkit/build-angular:tslint",
93+
"options": {
94+
"tsConfig": [
95+
"src/tsconfig.app.json",
96+
"src/tsconfig.spec.json"
97+
],
98+
"exclude": [
99+
"**/node_modules/**"
100+
]
101+
}
102+
}
103+
}
104+
},
105+
"ej2-angular7-multiselect-e2e": {
106+
"root": "e2e/",
107+
"projectType": "application",
108+
"prefix": "",
109+
"architect": {
110+
"e2e": {
111+
"builder": "@angular-devkit/build-angular:protractor",
112+
"options": {
113+
"protractorConfig": "e2e/protractor.conf.js",
114+
"devServerTarget": "ej2-angular7-multiselect:serve"
115+
},
116+
"configurations": {
117+
"production": {
118+
"devServerTarget": "ej2-angular7-multiselect:serve:production"
119+
}
120+
}
121+
},
122+
"lint": {
123+
"builder": "@angular-devkit/build-angular:tslint",
124+
"options": {
125+
"tsConfig": "e2e/tsconfig.e2e.json",
126+
"exclude": [
127+
"**/node_modules/**"
128+
]
129+
}
130+
}
131+
}
132+
}
133+
},
134+
"defaultProject": "ej2-angular7-multiselect"
135+
}

e2e/protractor.conf.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Protractor configuration file, see link for more information
2+
// https://github.com/angular/protractor/blob/master/lib/config.ts
3+
4+
const { SpecReporter } = require('jasmine-spec-reporter');
5+
6+
exports.config = {
7+
allScriptsTimeout: 11000,
8+
specs: [
9+
'./src/**/*.e2e-spec.ts'
10+
],
11+
capabilities: {
12+
'browserName': 'chrome'
13+
},
14+
directConnect: true,
15+
baseUrl: 'http://localhost:4200/',
16+
framework: 'jasmine',
17+
jasmineNodeOpts: {
18+
showColors: true,
19+
defaultTimeoutInterval: 30000,
20+
print: function() {}
21+
},
22+
onPrepare() {
23+
require('ts-node').register({
24+
project: require('path').join(__dirname, './tsconfig.e2e.json')
25+
});
26+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27+
}
28+
};

e2e/src/app.e2e-spec.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { AppPage } from './app.po';
2+
3+
describe('workspace-project App', () => {
4+
let page: AppPage;
5+
6+
beforeEach(() => {
7+
page = new AppPage();
8+
});
9+
10+
it('should display welcome message', () => {
11+
page.navigateTo();
12+
expect(page.getParagraphText()).toEqual('Welcome to ej2-angular7-multiselect!');
13+
});
14+
});

e2e/src/app.po.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
navigateTo() {
5+
return browser.get('/');
6+
}
7+
8+
getParagraphText() {
9+
return element(by.css('app-root h1')).getText();
10+
}
11+
}

e2e/tsconfig.e2e.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/app",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types": [
8+
"jasmine",
9+
"jasminewd2",
10+
"node"
11+
]
12+
}
13+
}

multiselect-dropdown.png

11.4 KB
Loading

package.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "ej2-angular7-multiselect",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "ng serve",
7+
"build": "ng build",
8+
"test": "ng test",
9+
"lint": "ng lint",
10+
"e2e": "ng e2e"
11+
},
12+
"private": true,
13+
"dependencies": {
14+
"@angular/animations": "~7.0.0",
15+
"@angular/common": "~7.0.0",
16+
"@angular/compiler": "~7.0.0",
17+
"@angular/core": "~7.0.0",
18+
"@angular/forms": "~7.0.0",
19+
"@angular/http": "~7.0.0",
20+
"@angular/platform-browser": "~7.0.0",
21+
"@angular/platform-browser-dynamic": "~7.0.0",
22+
"@angular/router": "~7.0.0",
23+
"@syncfusion/ej2-angular-dropdowns": "^16.3.34",
24+
"core-js": "^2.5.4",
25+
"rxjs": "~6.3.3",
26+
"zone.js": "~0.8.26"
27+
},
28+
"devDependencies": {
29+
"@angular-devkit/build-angular": "~0.10.0",
30+
"@angular/cli": "~7.0.4",
31+
"@angular/compiler-cli": "~7.0.0",
32+
"@angular/language-service": "~7.0.0",
33+
"@types/node": "~8.9.4",
34+
"@types/jasmine": "~2.8.8",
35+
"@types/jasminewd2": "~2.0.3",
36+
"codelyzer": "~4.5.0",
37+
"jasmine-core": "~2.99.1",
38+
"jasmine-spec-reporter": "~4.2.1",
39+
"karma": "~3.0.0",
40+
"karma-chrome-launcher": "~2.2.0",
41+
"karma-coverage-istanbul-reporter": "~2.0.1",
42+
"karma-jasmine": "~1.1.2",
43+
"karma-jasmine-html-reporter": "^0.2.2",
44+
"protractor": "~5.4.0",
45+
"ts-node": "~7.0.0",
46+
"tslint": "~5.11.0",
47+
"typescript": "~3.1.1"
48+
}
49+
}

src/app/app-routing.module.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
const routes: Routes = [];
5+
6+
@NgModule({
7+
imports: [RouterModule.forRoot(routes)],
8+
exports: [RouterModule]
9+
})
10+
export class AppRoutingModule { }

src/app/app.component.css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* You can add global styles to this file, and also import other style files */

src/app/app.component.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<ejs-multiselect id='localData' #local [dataSource]='countries' [fields]='localFields' [placeholder]='localWaterMark'></ejs-multiselect>

src/app/app.component.spec.ts

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { TestBed, async } from '@angular/core/testing';
2+
import { RouterTestingModule } from '@angular/router/testing';
3+
import { AppComponent } from './app.component';
4+
5+
describe('AppComponent', () => {
6+
beforeEach(async(() => {
7+
TestBed.configureTestingModule({
8+
imports: [
9+
RouterTestingModule
10+
],
11+
declarations: [
12+
AppComponent
13+
],
14+
}).compileComponents();
15+
}));
16+
17+
it('should create the app', () => {
18+
const fixture = TestBed.createComponent(AppComponent);
19+
const app = fixture.debugElement.componentInstance;
20+
expect(app).toBeTruthy();
21+
});
22+
23+
it(`should have as title 'ej2-angular7-multiselect'`, () => {
24+
const fixture = TestBed.createComponent(AppComponent);
25+
const app = fixture.debugElement.componentInstance;
26+
expect(app.title).toEqual('ej2-angular7-multiselect');
27+
});
28+
29+
it('should render title in a h1 tag', () => {
30+
const fixture = TestBed.createComponent(AppComponent);
31+
fixture.detectChanges();
32+
const compiled = fixture.debugElement.nativeElement;
33+
expect(compiled.querySelector('h1').textContent).toContain('Welcome to ej2-angular7-multiselect!');
34+
});
35+
});

src/app/app.component.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-root',
5+
templateUrl: './app.component.html',
6+
styleUrls: ['./app.component.css'],
7+
})
8+
export class AppComponent {
9+
// define the JSON of data
10+
public countries: { [key: string]: Object; }[] = [
11+
{ Name: 'Australia', Code: 'AU' },
12+
{ Name: 'Bermuda', Code: 'BM' },
13+
{ Name: 'Canada', Code: 'CA' },
14+
{ Name: 'Cameroon', Code: 'CM' },
15+
{ Name: 'Denmark', Code: 'DK' },
16+
{ Name: 'France', Code: 'FR' },
17+
{ Name: 'Finland', Code: 'FI' },
18+
{ Name: 'Germany', Code: 'DE' },
19+
20+
];
21+
// maps the local data column to fields property
22+
public localFields: Object = { text: 'Name', value: 'Code' };
23+
// set the placeholder to MultiSelect input element
24+
public localWaterMark: string = 'Select countries';
25+
26+
}

src/app/app.module.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { BrowserModule } from '@angular/platform-browser';
2+
import { NgModule } from '@angular/core';
3+
import { AppComponent } from './app.component';
4+
import {MultiSelectAllModule } from '@syncfusion/ej2-angular-dropdowns';
5+
6+
@NgModule({
7+
declarations: [
8+
AppComponent
9+
],
10+
imports: [
11+
BrowserModule, MultiSelectAllModule
12+
],
13+
14+
bootstrap: [AppComponent]
15+
})
16+
export class AppModule { }

0 commit comments

Comments
 (0)