Skip to content

Commit 716bd91

Browse files
authored
Add files via upload
Angular 7 DropdownList sample added.
1 parent 1f1ff88 commit 716bd91

27 files changed

+747
-2
lines changed

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
1-
# ej2-angular-7-dropdownlist
2-
A quick start project that helps you to create an Angular 7 DropdownList with minimal code configuration.
1+
# Syncfusion Angular 7 Dropdown List Quick Start Project
2+
3+
A quick start project that helps you to create the Syncfusion Angular 7 Dropdown List with minimal code configuration.
4+
5+
![Angular 7 Dropdown List](dropdownlist.png)
6+
7+
## Dropdown List 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 Dropdown List features included in this project are as follows.
10+
* Angular 7 Dropdown List initialization.
11+
* Data binding to the Dropdown List.
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-dropdownlist` 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-dropdownlist.git
22+
cd ej2-angular-7-dropdownlist
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

Lines changed: 135 additions & 0 deletions
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+
"syncfusion-angular-app": {
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/syncfusion-angular-app",
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": "syncfusion-angular-app:build"
61+
},
62+
"configurations": {
63+
"production": {
64+
"browserTarget": "syncfusion-angular-app:build:production"
65+
}
66+
}
67+
},
68+
"extract-i18n": {
69+
"builder": "@angular-devkit/build-angular:extract-i18n",
70+
"options": {
71+
"browserTarget": "syncfusion-angular-app: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+
"syncfusion-angular-app-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": "syncfusion-angular-app:serve"
115+
},
116+
"configurations": {
117+
"production": {
118+
"devServerTarget": "syncfusion-angular-app: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": "syncfusion-angular-app"
135+
}

dropdownlist.png

17.3 KB
Loading

e2e/protractor.conf.js

Lines changed: 28 additions & 0 deletions
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

Lines changed: 14 additions & 0 deletions
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 syncfusion-angular-app!');
13+
});
14+
});

e2e/src/app.po.ts

Lines changed: 11 additions & 0 deletions
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

Lines changed: 13 additions & 0 deletions
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+
}

package.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "ej2-angular-7-dropdownlist",
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": "^17.1.49",
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.5",
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.6"
48+
}
49+
}

src/app/app.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<ejs-dropdownlist id='localData' #local [dataSource]='countries' [fields]='localFields' [placeholder]='localWaterMark'></ejs-dropdownlist>

src/app/app.component.spec.ts

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

0 commit comments

Comments
 (0)