Skip to content

Commit ad0632b

Browse files
Getting started with the angular pivot table component in angular 18
1 parent 2fea0af commit ad0632b

20 files changed

+823
-2
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://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+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
!.vscode/settings.json
26+
!.vscode/tasks.json
27+
!.vscode/launch.json
28+
!.vscode/extensions.json
29+
.history/*
30+
31+
# Miscellaneous
32+
/.angular/cache
33+
.sass-cache/
34+
/connect.lock
35+
/coverage
36+
/libpeerconnection.log
37+
testem.log
38+
/typings
39+
40+
# System files
41+
.DS_Store
42+
Thumbs.db

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1-
# getting-started-with-the-angular-pivot-table-component-in-angular-18
2-
A quick-start project that demonstrates how to integrate a angular pivot table component into a angular application with some of its fundamental features such as FieldList, GroupingBar, and CalculatedField.
1+
# Getting Started with the Angular Pivot Table Component
2+
A quick-start project that helps you to create and configure the Syncfusion Angular Pivot Table. This project also includes a code snippet to add required fields in the Angular Pivot Table and shows you how to add useful features like a grouping bar, filtering, formatting, Calculated field, Sorting and a field list.
3+
4+
Refer to the following documentation to learn about the Angular Pivot Table component: https://ej2.syncfusion.com/angular/documentation/pivotview/getting-started
5+
6+
Check out this online example of the Blazor Pivot Table component: https://ej2.syncfusion.com/angular/demos/#/bootstrap5/pivot-table/default
7+
8+
## Project prerequisites
9+
10+
Make sure that you have the latest versions of NodeJS and Visual Studio Code in your machine before starting to work on this project.
11+
12+
## How to run this application?
13+
To run this application, you need to clone the `Getting Started with the Angular Pivot Table Component` repository and then open it in Visual Studio Code. Now, simply install all the necessary angular packages into your current project using the `npm install` command and run your project using the `ng serve` command

angular.json

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"my-app": {
7+
"projectType": "application",
8+
"schematics": {},
9+
"root": "",
10+
"sourceRoot": "src",
11+
"prefix": "app",
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:application",
15+
"options": {
16+
"outputPath": "dist/my-app",
17+
"index": "src/index.html",
18+
"browser": "src/main.ts",
19+
"polyfills": [
20+
"zone.js"
21+
],
22+
"tsConfig": "tsconfig.app.json",
23+
"assets": [
24+
{
25+
"glob": "**/*",
26+
"input": "public"
27+
}
28+
],
29+
"styles": [
30+
"src/styles.css"
31+
],
32+
"scripts": [],
33+
"server": "src/main.server.ts",
34+
"prerender": true,
35+
"ssr": {
36+
"entry": "server.ts"
37+
}
38+
},
39+
"configurations": {
40+
"production": {
41+
"budgets": [
42+
{
43+
"type": "initial",
44+
"maximumWarning": "500kB",
45+
"maximumError": "1MB"
46+
},
47+
{
48+
"type": "anyComponentStyle",
49+
"maximumWarning": "2kB",
50+
"maximumError": "4kB"
51+
}
52+
],
53+
"outputHashing": "all"
54+
},
55+
"development": {
56+
"optimization": false,
57+
"extractLicenses": false,
58+
"sourceMap": true
59+
}
60+
},
61+
"defaultConfiguration": "production"
62+
},
63+
"serve": {
64+
"builder": "@angular-devkit/build-angular:dev-server",
65+
"configurations": {
66+
"production": {
67+
"buildTarget": "my-app:build:production"
68+
},
69+
"development": {
70+
"buildTarget": "my-app:build:development"
71+
}
72+
},
73+
"defaultConfiguration": "development"
74+
},
75+
"extract-i18n": {
76+
"builder": "@angular-devkit/build-angular:extract-i18n"
77+
},
78+
"test": {
79+
"builder": "@angular-devkit/build-angular:karma",
80+
"options": {
81+
"polyfills": [
82+
"zone.js",
83+
"zone.js/testing"
84+
],
85+
"tsConfig": "tsconfig.spec.json",
86+
"assets": [
87+
{
88+
"glob": "**/*",
89+
"input": "public"
90+
}
91+
],
92+
"styles": [
93+
"src/styles.css"
94+
],
95+
"scripts": []
96+
}
97+
}
98+
}
99+
}
100+
},
101+
"cli": {
102+
"analytics": "cefe4e35-2851-41ff-87dc-3123716d3a07"
103+
}
104+
}

package.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "my-app",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "ng serve",
7+
"build": "ng build",
8+
"watch": "ng build --watch --configuration development",
9+
"test": "ng test",
10+
"serve:ssr:my-app": "node dist/my-app/server/server.mjs"
11+
},
12+
"private": true,
13+
"dependencies": {
14+
"@angular/animations": "^18.0.0",
15+
"@angular/common": "^18.0.0",
16+
"@angular/compiler": "^18.0.0",
17+
"@angular/core": "^18.0.0",
18+
"@angular/forms": "^18.0.0",
19+
"@angular/platform-browser": "^18.0.0",
20+
"@angular/platform-browser-dynamic": "^18.0.0",
21+
"@angular/platform-server": "^18.0.0",
22+
"@angular/router": "^18.0.0",
23+
"@angular/ssr": "^18.0.7",
24+
"@syncfusion/ej2-angular-pivotview": "^26.1.40",
25+
"express": "^4.18.2",
26+
"rxjs": "~7.8.0",
27+
"tslib": "^2.3.0",
28+
"zone.js": "~0.14.3"
29+
},
30+
"devDependencies": {
31+
"@angular-devkit/build-angular": "^18.0.7",
32+
"@angular/cli": "^18.0.7",
33+
"@angular/compiler-cli": "^18.0.0",
34+
"@types/express": "^4.17.17",
35+
"@types/jasmine": "~5.1.0",
36+
"@types/node": "^18.18.0",
37+
"jasmine-core": "~5.1.0",
38+
"karma": "~6.4.0",
39+
"karma-chrome-launcher": "~3.2.0",
40+
"karma-coverage": "~2.2.0",
41+
"karma-jasmine": "~5.1.0",
42+
"karma-jasmine-html-reporter": "~2.1.0",
43+
"typescript": "~5.4.2"
44+
}
45+
}

server.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { APP_BASE_HREF } from '@angular/common';
2+
import { CommonEngine } from '@angular/ssr';
3+
import express from 'express';
4+
import { fileURLToPath } from 'node:url';
5+
import { dirname, join, resolve } from 'node:path';
6+
import bootstrap from './src/main.server';
7+
8+
// The Express app is exported so that it can be used by serverless Functions.
9+
export function app(): express.Express {
10+
const server = express();
11+
const serverDistFolder = dirname(fileURLToPath(import.meta.url));
12+
const browserDistFolder = resolve(serverDistFolder, '../browser');
13+
const indexHtml = join(serverDistFolder, 'index.server.html');
14+
15+
const commonEngine = new CommonEngine();
16+
17+
server.set('view engine', 'html');
18+
server.set('views', browserDistFolder);
19+
20+
// Example Express Rest API endpoints
21+
// server.get('/api/**', (req, res) => { });
22+
// Serve static files from /browser
23+
server.get('**', express.static(browserDistFolder, {
24+
maxAge: '1y',
25+
index: 'index.html',
26+
}));
27+
28+
// All regular routes use the Angular engine
29+
server.get('**', (req, res, next) => {
30+
const { protocol, originalUrl, baseUrl, headers } = req;
31+
32+
commonEngine
33+
.render({
34+
bootstrap,
35+
documentFilePath: indexHtml,
36+
url: `${protocol}://${headers.host}${originalUrl}`,
37+
publicPath: browserDistFolder,
38+
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }],
39+
})
40+
.then((html) => res.send(html))
41+
.catch((err) => next(err));
42+
});
43+
44+
return server;
45+
}
46+
47+
function run(): void {
48+
const port = process.env['PORT'] || 4000;
49+
50+
// Start up the Node server
51+
const server = app();
52+
server.listen(port, () => {
53+
console.log(`Node Express server listening on http://localhost:${port}`);
54+
});
55+
}
56+
57+
run();

src/app/app.component.css

Whitespace-only changes.

0 commit comments

Comments
 (0)