Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

Commit 1963aa6

Browse files
committed
Migrate ag-Grid Angular CLI example to here
1 parent 44f8917 commit 1963aa6

76 files changed

Lines changed: 15582 additions & 1 deletion

Some content is hidden

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

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = 0
13+
trim_trailing_whitespace = false

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
7+
# dependencies
8+
/node_modules
9+
/bower_components
10+
11+
# IDEs and editors
12+
/.idea
13+
/.vscode
14+
.project
15+
.classpath
16+
*.launch
17+
.settings/
18+
19+
# misc
20+
/.sass-cache
21+
/connect.lock
22+
/coverage/*
23+
/libpeerconnection.log
24+
npm-debug.log
25+
testem.log
26+
/typings
27+
28+
# e2e
29+
/e2e/*.js
30+
/e2e/*.map
31+
32+
#System Files
33+
.DS_Store
34+
Thumbs.db

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,40 @@
1-
ag-grid Angular CLI Example
1+
2+
ag-Grid-angular-examples - angular-cli
3+
==================================
4+
5+
Example of using ag-Grid with Angular and TypeScript
6+
7+
**Note** We only show the "Rich Grid" example in use here. For the full set of examples please look under the **../ngtools_webpack** folder
8+
9+
Building
10+
========
11+
12+
Install Dependencies:
13+
14+
- `npm install`
15+
16+
Dev Server
17+
=========
18+
19+
To build & run:
20+
21+
- `ng serve`
22+
23+
Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
24+
25+
Building
26+
========
27+
28+
To build:
29+
30+
- `ng build`
31+
32+
To do a prod build:
33+
34+
- `ng build --prod`
35+
36+
To do a AOT build:
37+
38+
- `ng build --aot`
39+
40+
The build artifacts will be stored in the `dist/` directory.

angular.json

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"ag-grid-angular-cli": {
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/",
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+
"src/images"
25+
],
26+
"styles": [
27+
"node_modules/ag-grid/dist/styles/ag-grid.css",
28+
"node_modules/ag-grid/dist/styles/theme-fresh.css",
29+
"node_modules/bootstrap/dist/css/bootstrap.min.css"
30+
],
31+
"scripts": []
32+
},
33+
"configurations": {
34+
"production": {
35+
"fileReplacements": [
36+
{
37+
"replace": "src/environments/environment.ts",
38+
"with": "src/environments/environment.prod.ts"
39+
}
40+
],
41+
"optimization": true,
42+
"outputHashing": "all",
43+
"sourceMap": false,
44+
"extractCss": true,
45+
"namedChunks": false,
46+
"aot": true,
47+
"extractLicenses": true,
48+
"vendorChunk": false,
49+
"buildOptimizer": true
50+
}
51+
}
52+
},
53+
"serve": {
54+
"builder": "@angular-devkit/build-angular:dev-server",
55+
"options": {
56+
"browserTarget": "ag-grid-angular-cli:build"
57+
},
58+
"configurations": {
59+
"production": {
60+
"browserTarget": "ag-grid-angular-cli:build:production"
61+
}
62+
}
63+
},
64+
"extract-i18n": {
65+
"builder": "@angular-devkit/build-angular:extract-i18n",
66+
"options": {
67+
"browserTarget": "ag-grid-angular-cli:build"
68+
}
69+
},
70+
"test": {
71+
"builder": "@angular-devkit/build-angular:karma",
72+
"options": {
73+
"main": "src/test.ts",
74+
"polyfills": "src/polyfills.ts",
75+
"tsConfig": "src/tsconfig.spec.json",
76+
"karmaConfig": "src/karma.conf.js",
77+
"styles": [
78+
"src/styles.css"
79+
],
80+
"scripts": [],
81+
"assets": [
82+
"src/favicon.ico",
83+
"src/assets"
84+
]
85+
}
86+
},
87+
"lint": {
88+
"builder": "@angular-devkit/build-angular:tslint",
89+
"options": {
90+
"tsConfig": [
91+
"src/tsconfig.app.json",
92+
"src/tsconfig.spec.json"
93+
],
94+
"exclude": [
95+
"**/node_modules/**"
96+
]
97+
}
98+
}
99+
}
100+
},
101+
"ag-grid-angular-cli-e2e": {
102+
"root": "e2e/",
103+
"projectType": "application",
104+
"architect": {
105+
"e2e": {
106+
"builder": "@angular-devkit/build-angular:protractor",
107+
"options": {
108+
"protractorConfig": "e2e/protractor.conf.js",
109+
"devServerTarget": "ag-grid-angular-cli:serve"
110+
},
111+
"configurations": {
112+
"production": {
113+
"devServerTarget": "ag-grid-angular-cli:serve:production"
114+
}
115+
}
116+
},
117+
"lint": {
118+
"builder": "@angular-devkit/build-angular:tslint",
119+
"options": {
120+
"tsConfig": "e2e/tsconfig.e2e.json",
121+
"exclude": [
122+
"**/node_modules/**"
123+
]
124+
}
125+
}
126+
}
127+
}
128+
},
129+
"defaultProject": "ag-grid-angular-cli"
130+
}

e2e/app.e2e-spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { AngularCliPage } from './app.po';
2+
3+
describe('angular-cli App', function() {
4+
let page: AngularCliPage;
5+
6+
beforeEach(() => {
7+
page = new AngularCliPage();
8+
});
9+
10+
it('should display message saying app works', () => {
11+
page.navigateTo();
12+
expect(page.getParagraphText()).toEqual('app works!');
13+
});
14+
});

e2e/app.po.ts

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

e2e/tsconfig.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"declaration": false,
5+
"emitDecoratorMetadata": true,
6+
"experimentalDecorators": true,
7+
"module": "commonjs",
8+
"moduleResolution": "node",
9+
"outDir": "../dist/out-tsc-e2e",
10+
"sourceMap": true,
11+
"target": "es5",
12+
"typeRoots": [
13+
"../node_modules/@types"
14+
]
15+
}
16+
}

gulpfile.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const gulp = require('gulp');
2+
const del = require('del');
3+
const runSequence = require('run-sequence');
4+
5+
gulp.task('copy-from-ag-grid', () => {
6+
return gulp.src(['../../ag-grid/*', '../ag-grid/dist/**/*'], {base: '../../ag-grid'})
7+
.pipe(gulp.dest('./node_modules/ag-grid'));
8+
});
9+
10+
gulp.task('copy-from-ag-grid-enterprise', () => {
11+
return gulp.src(['../../ag-grid-enterprise/*', '../../ag-grid-enterprise/dist/**/*'], {base: '../../ag-grid-enterprise'})
12+
.pipe(gulp.dest('./node_modules/ag-grid-enterprise'));
13+
});
14+
15+
gulp.task('copy-from-ag-grid-angular', () => {
16+
return gulp.src(['../../ag-grid-angular/*', '../../ag-grid-angular/dist/**/*'], {base: '../../ag-grid-angular'})
17+
.pipe(gulp.dest('./node_modules/ag-grid-angular'));
18+
});
19+
20+
gulp.task('clean-nm-ag-grid-enterprise', () => {
21+
del(['node_modules/ag-grid-enterprise', '!node_modules']);
22+
});
23+
24+
gulp.task('clean-nm-ag-grid', () => {
25+
del(['node_modules/ag-grid', '!node_modules']);
26+
});
27+
28+
gulp.task('copy-nm-dirs', (callback) => {
29+
runSequence('copy-from-ag-grid', 'copy-from-ag-grid-enterprise', callback);
30+
});
31+
32+
gulp.task('watch', ['copy-nm-dirs'], () => {
33+
gulp.watch(['../ag-grid/dist/**/*', '../ag-grid/src/**/*'], ['copy-from-ag-grid']);
34+
gulp.watch(['../ag-grid-enterprise/dist/**/*', '../ag-grid-enterprise/src/**/*'], ['copy-from-ag-grid-enterprise']);
35+
});

karma.conf.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/0.13/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', 'angular-cli'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-remap-istanbul'),
12+
require('angular-cli/plugins/karma')
13+
],
14+
files: [
15+
16+
],
17+
preprocessors: {
18+
'./src/test.ts': ['angular-cli']
19+
},
20+
remapIstanbulReporter: {
21+
dir: require('path').join(__dirname, 'coverage'), reports: {
22+
html: 'coverage',
23+
lcovonly: './coverage/coverage.lcov'
24+
}
25+
},
26+
angularCli: {
27+
config: './angular-cli.json',
28+
environment: 'dev'
29+
},
30+
reporters: config.angularCli && config.angularCli.codeCoverage
31+
? ['progress', 'karma-remap-istanbul']
32+
: ['progress'],
33+
port: 9876,
34+
colors: true,
35+
logLevel: config.LOG_INFO,
36+
autoWatch: true,
37+
browsers: ['Chrome'],
38+
singleRun: false
39+
});
40+
};

0 commit comments

Comments
 (0)