├── README.md ├── angular-8-client ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── browserslist ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── components │ │ │ ├── add-tutorial │ │ │ │ ├── add-tutorial.component.css │ │ │ │ ├── add-tutorial.component.html │ │ │ │ ├── add-tutorial.component.spec.ts │ │ │ │ └── add-tutorial.component.ts │ │ │ ├── tutorial-details │ │ │ │ ├── tutorial-details.component.css │ │ │ │ ├── tutorial-details.component.html │ │ │ │ ├── tutorial-details.component.spec.ts │ │ │ │ └── tutorial-details.component.ts │ │ │ └── tutorials-list │ │ │ │ ├── tutorials-list.component.css │ │ │ │ ├── tutorials-list.component.html │ │ │ │ ├── tutorials-list.component.spec.ts │ │ │ │ └── tutorials-list.component.ts │ │ └── services │ │ │ ├── tutorial.service.spec.ts │ │ │ └── tutorial.service.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ └── test.ts ├── static │ ├── 3rdpartylicenses.txt │ ├── favicon.ico │ ├── index.html │ ├── main-es2015.89cb0b736f3e19c70d39.js │ ├── main-es5.89cb0b736f3e19c70d39.js │ ├── polyfills-es2015.5b10b8fd823b6392f1fd.js │ ├── polyfills-es5.8e50a9832860f7cf804a.js │ ├── runtime-es2015.c5fa8325f89fc516600b.js │ ├── runtime-es5.c5fa8325f89fc516600b.js │ └── styles.3ff695c00d717f2d2a11.css ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.spec.json └── tslint.json ├── spring-boot-angular-8-crud-example-architecture.png ├── spring-boot-angular-8-crud-example-create-tutorial.png ├── spring-boot-angular-8-crud-example-retrieve-tutorial.png ├── spring-boot-angular-8-crud-example-search-tutorial.png ├── spring-boot-angular-8-crud-example-update-tutorial.png ├── spring-boot-angular-8-crud-example.png └── spring-boot-server ├── .gitignore ├── .mvn └── wrapper │ ├── MavenWrapperDownloader.java │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── README.md ├── mvnw ├── mvnw.cmd ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── bezkoder │ │ └── spring │ │ └── jpa │ │ └── h2 │ │ ├── SpringBootJpaH2Application.java │ │ ├── controller │ │ └── TutorialController.java │ │ ├── model │ │ └── Tutorial.java │ │ └── repository │ │ └── TutorialRepository.java └── resources │ └── application.properties └── test └── java └── com └── bezkoder └── spring └── jpa └── h2 └── SpringBootJpaH2ApplicationTests.java /README.md: -------------------------------------------------------------------------------- 1 | # Spring Boot + Angular 8: CRUD example 2 | 3 | In this tutorial, I will show you how to build a full-stack (Spring Boot + Angular 8) example with a CRUD Application. The back-end server uses Spring Boot, Spring Data for REST APIs, front-end side is an Angular 8 App with HttpClient and Form Module. 4 | 5 | The Tutorial Application in that: 6 | - Tutorial has id, title, description, published status. 7 | - User can create, retrieve, update, delete Tutorials. 8 | - There is a search box for finding Tutorials by title. 9 | 10 | Add an object: 11 | 12 | ![spring-boot-angular-8-crud-example-create-tutorial](spring-boot-angular-8-crud-example-create-tutorial.png) 13 | 14 | Retrieve all objects: 15 | 16 | ![spring-boot-angular-8-crud-example](spring-boot-angular-8-crud-example.png) 17 | 18 | Click on **Edit** button to go to a Tutorial page: 19 | 20 | ![spring-boot-angular-8-crud-example-retrieve-tutorial](spring-boot-angular-8-crud-example-retrieve-tutorial.png) 21 | 22 | On this Page, you can: 23 | 24 | - change status to *Published* using **Publish** button 25 | - delete the Tutorial using **Delete** button 26 | - update the Tutorial details with **Update** button 27 | 28 | ![spring-boot-angular-8-crud-example-update-tutorial](spring-boot-angular-8-crud-example-update-tutorial.png) 29 | 30 | Search Tutorials by title: 31 | 32 | ![spring-boot-angular-8-crud-example-search-tutorial](spring-boot-angular-8-crud-example-search-tutorial.png) 33 | 34 | ## Angular 8 & Spring Boot CRUD Architecture 35 | This is the application architecture we will build: 36 | 37 | ![spring-boot-angular-8-crud-example-architecture](spring-boot-angular-8-crud-example-architecture.png) 38 | 39 | - Spring Boot exports REST Apis using Spring Web MVC & interacts with embedded Database using Spring Data JPA. 40 | - Angular Client sends HTTP Requests and retrieve HTTP Responses using axios, shows data on the components. We also use Angular Router for navigating to pages. 41 | 42 | ## Video 43 | This is our Angular Spring Boot CRUD application demo and brief instruction, running with MySQL database: 44 | 45 | [![Angular Spring Boot CRUD application demo](http://img.youtube.com/vi/K8mV6XWA_EY/0.jpg)](http://www.youtube.com/watch?v=K8mV6XWA_EY "Angular Spring Boot CRUD application demo") 46 | 47 | In the video, we use Angular 10, but it has the same logic & UI as Angular version 8 and H2 database in this tutorial. 48 | 49 | Tutorial link: [Spring Boot + Angular 8: CRUD example](https://www.bezkoder.com/angular-spring-boot-crud//) 50 | 51 | More Practice: 52 | > [Angular 8 + Spring Boot + MySQL](https://www.bezkoder.com/angular-spring-boot-mysql/) 53 | 54 | > [Angular 8 + Spring Boot + PostgreSQL](https://www.bezkoder.com/angular-spring-boot-postgresql/) 55 | 56 | > [Angular 8 + Spring Boot + MongoDB](https://www.bezkoder.com/angular-spring-boot-mongodb/) 57 | 58 | > [Angular 8 + Spring Boot: File Upload example](https://www.bezkoder.com/angular-spring-boot-file-upload/) 59 | 60 | Security: 61 | > [Angular 8 + Spring Boot: JWT Authentication & Authorization example](https://www.bezkoder.com/angular-spring-boot-jwt-auth/) 62 | -------------------------------------------------------------------------------- /angular-8-client/.editorconfig: -------------------------------------------------------------------------------- 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 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /angular-8-client/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | speed-measure-plugin*.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /angular-8-client/README.md: -------------------------------------------------------------------------------- 1 | # Angular 8 CRUD application example with Web API 2 | 3 | For instruction, please visit: 4 | > [Angular 8 CRUD application example with Web API](https://bezkoder.com/angular-crud-app/) 5 | 6 | More Practice: 7 | > [Angular 8 Pagination example | ngx-pagination](https://bezkoder.com/ngx-pagination-angular-8/) 8 | 9 | > [Angular 8 Multiple Files upload example](https://bezkoder.com/angular-multiple-files-upload/) 10 | 11 | Fullstack with Node.js Express: 12 | > [Angular 8 + Node.js Express + MySQL](https://bezkoder.com/angular-node-express-mysql/) 13 | 14 | > [Angular 8 + Node.js Express + PostgreSQL](https://bezkoder.com/angular-node-express-postgresql/) 15 | 16 | > [Angular 8 + Node.js Express + MongoDB](https://bezkoder.com/angular-mongodb-node-express/) 17 | 18 | Fullstack with Spring Boot: 19 | > [Angular 8 + Spring Boot + MySQL](https://bezkoder.com/angular-spring-boot-crud/) 20 | 21 | > [Angular 8 + Spring Boot + PostgreSQL](https://bezkoder.com/angular-spring-boot-postgresql/) 22 | 23 | > [Angular 8 + Spring Boot + MongoDB](https://bezkoder.com/angular-spring-boot-mongodb/) 24 | 25 | Fullstack with Django: 26 | > [Angular 8 + Django Rest Framework](https://bezkoder.com/django-angular-crud-rest-framework/) 27 | 28 | > [Angular 8 + Django + MySQL](https://bezkoder.com/django-angular-mysql/) 29 | 30 | > [Angular 8 + Django + PostgreSQL](https://bezkoder.com/django-angular-postgresql/) 31 | 32 | Serverless with Firebase: 33 | > [Angular 8 CRUD with Firebase Realtime Database](https://bezkoder.com/angular-8-firebase-crud/) 34 | 35 | ## Development server 36 | 37 | Run `ng serve --port 8081` for a dev server. Navigate to `http://localhost:8081/`. The app will automatically reload if you change any of the source files. 38 | 39 | ## Code scaffolding 40 | 41 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 42 | 43 | ## Build 44 | 45 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 46 | 47 | ## Running unit tests 48 | 49 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 50 | 51 | ## Running end-to-end tests 52 | 53 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 54 | 55 | ## Further help 56 | 57 | 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). 58 | -------------------------------------------------------------------------------- /angular-8-client/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "Angular8ClientCrud": { 7 | "projectType": "application", 8 | "schematics": {}, 9 | "root": "", 10 | "sourceRoot": "src", 11 | "prefix": "app", 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "./static", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "tsconfig.app.json", 21 | "aot": false, 22 | "assets": [ 23 | "src/favicon.ico", 24 | "src/assets" 25 | ], 26 | "styles": [ 27 | "src/styles.css" 28 | ], 29 | "scripts": [] 30 | }, 31 | "configurations": { 32 | "production": { 33 | "fileReplacements": [ 34 | { 35 | "replace": "src/environments/environment.ts", 36 | "with": "src/environments/environment.prod.ts" 37 | } 38 | ], 39 | "optimization": true, 40 | "outputHashing": "all", 41 | "sourceMap": false, 42 | "extractCss": true, 43 | "namedChunks": false, 44 | "aot": true, 45 | "extractLicenses": true, 46 | "vendorChunk": false, 47 | "buildOptimizer": true, 48 | "budgets": [ 49 | { 50 | "type": "initial", 51 | "maximumWarning": "2mb", 52 | "maximumError": "5mb" 53 | }, 54 | { 55 | "type": "anyComponentStyle", 56 | "maximumWarning": "6kb", 57 | "maximumError": "10kb" 58 | } 59 | ] 60 | } 61 | } 62 | }, 63 | "serve": { 64 | "builder": "@angular-devkit/build-angular:dev-server", 65 | "options": { 66 | "browserTarget": "Angular8ClientCrud:build" 67 | }, 68 | "configurations": { 69 | "production": { 70 | "browserTarget": "Angular8ClientCrud:build:production" 71 | } 72 | } 73 | }, 74 | "extract-i18n": { 75 | "builder": "@angular-devkit/build-angular:extract-i18n", 76 | "options": { 77 | "browserTarget": "Angular8ClientCrud:build" 78 | } 79 | }, 80 | "test": { 81 | "builder": "@angular-devkit/build-angular:karma", 82 | "options": { 83 | "main": "src/test.ts", 84 | "polyfills": "src/polyfills.ts", 85 | "tsConfig": "tsconfig.spec.json", 86 | "karmaConfig": "karma.conf.js", 87 | "assets": [ 88 | "src/favicon.ico", 89 | "src/assets" 90 | ], 91 | "styles": [ 92 | "src/styles.css" 93 | ], 94 | "scripts": [] 95 | } 96 | }, 97 | "lint": { 98 | "builder": "@angular-devkit/build-angular:tslint", 99 | "options": { 100 | "tsConfig": [ 101 | "tsconfig.app.json", 102 | "tsconfig.spec.json", 103 | "e2e/tsconfig.json" 104 | ], 105 | "exclude": [ 106 | "**/node_modules/**" 107 | ] 108 | } 109 | }, 110 | "e2e": { 111 | "builder": "@angular-devkit/build-angular:protractor", 112 | "options": { 113 | "protractorConfig": "e2e/protractor.conf.js", 114 | "devServerTarget": "Angular8ClientCrud:serve" 115 | }, 116 | "configurations": { 117 | "production": { 118 | "devServerTarget": "Angular8ClientCrud:serve:production" 119 | } 120 | } 121 | } 122 | } 123 | }}, 124 | "defaultProject": "Angular8ClientCrud" 125 | } -------------------------------------------------------------------------------- /angular-8-client/browserslist: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /angular-8-client/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | browserName: 'chrome' 17 | }, 18 | directConnect: true, 19 | baseUrl: 'http://localhost:4200/', 20 | framework: 'jasmine', 21 | jasmineNodeOpts: { 22 | showColors: true, 23 | defaultTimeoutInterval: 30000, 24 | print: function() {} 25 | }, 26 | onPrepare() { 27 | require('ts-node').register({ 28 | project: require('path').join(__dirname, './tsconfig.json') 29 | }); 30 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 31 | } 32 | }; -------------------------------------------------------------------------------- /angular-8-client/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Angular8ClientCrud app is running!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /angular-8-client/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root .content span')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /angular-8-client/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /angular-8-client/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, './coverage/Angular8ClientCrud'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /angular-8-client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular8-client-crud", 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": "~8.2.14", 15 | "@angular/common": "~8.2.14", 16 | "@angular/compiler": "~8.2.14", 17 | "@angular/core": "~8.2.14", 18 | "@angular/forms": "~8.2.14", 19 | "@angular/platform-browser": "~8.2.14", 20 | "@angular/platform-browser-dynamic": "~8.2.14", 21 | "@angular/router": "~8.2.14", 22 | "rxjs": "~6.4.0", 23 | "tslib": "^1.10.0", 24 | "zone.js": "~0.9.1" 25 | }, 26 | "devDependencies": { 27 | "@angular-devkit/build-angular": "~0.803.21", 28 | "@angular/cli": "~8.3.21", 29 | "@angular/compiler-cli": "~8.2.14", 30 | "@angular/language-service": "~8.2.14", 31 | "@types/node": "~8.9.4", 32 | "@types/jasmine": "~3.3.8", 33 | "@types/jasminewd2": "~2.0.3", 34 | "codelyzer": "^5.0.0", 35 | "jasmine-core": "~3.4.0", 36 | "jasmine-spec-reporter": "~4.2.1", 37 | "karma": "~4.1.0", 38 | "karma-chrome-launcher": "~2.2.0", 39 | "karma-coverage-istanbul-reporter": "~2.0.1", 40 | "karma-jasmine": "~2.0.1", 41 | "karma-jasmine-html-reporter": "^1.4.0", 42 | "protractor": "~5.4.0", 43 | "ts-node": "~7.0.0", 44 | "tslint": "~5.15.0", 45 | "typescript": "~3.5.3" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /angular-8-client/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { TutorialsListComponent } from './components/tutorials-list/tutorials-list.component'; 4 | import { TutorialDetailsComponent } from './components/tutorial-details/tutorial-details.component'; 5 | import { AddTutorialComponent } from './components/add-tutorial/add-tutorial.component'; 6 | 7 | const routes: Routes = [ 8 | { path: '', redirectTo: 'tutorials', pathMatch: 'full' }, 9 | { path: 'tutorials', component: TutorialsListComponent }, 10 | { path: 'tutorials/:id', component: TutorialDetailsComponent }, 11 | { path: 'add', component: AddTutorialComponent } 12 | ]; 13 | 14 | @NgModule({ 15 | imports: [RouterModule.forRoot(routes, {useHash: true})], 16 | exports: [RouterModule] 17 | }) 18 | export class AppRoutingModule { } 19 | -------------------------------------------------------------------------------- /angular-8-client/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bezkoder/spring-boot-angular-8-crud-example/4c8538075f67ec3dc04af6ee0da1173ef9304166/angular-8-client/src/app/app.component.css -------------------------------------------------------------------------------- /angular-8-client/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 | 13 | 14 |
15 | 16 |
17 |
18 | -------------------------------------------------------------------------------- /angular-8-client/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 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 'Angular8ClientCrud'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.debugElement.componentInstance; 26 | expect(app.title).toEqual('Angular8ClientCrud'); 27 | }); 28 | 29 | it('should render title', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.debugElement.nativeElement; 33 | expect(compiled.querySelector('.content span').textContent).toContain('Angular8ClientCrud app is running!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /angular-8-client/src/app/app.component.ts: -------------------------------------------------------------------------------- 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 | title = 'Angular8ClientCrud'; 10 | } 11 | -------------------------------------------------------------------------------- /angular-8-client/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { HttpClientModule } from '@angular/common/http'; 5 | 6 | import { AppRoutingModule } from './app-routing.module'; 7 | import { AppComponent } from './app.component'; 8 | import { AddTutorialComponent } from './components/add-tutorial/add-tutorial.component'; 9 | import { TutorialDetailsComponent } from './components/tutorial-details/tutorial-details.component'; 10 | import { TutorialsListComponent } from './components/tutorials-list/tutorials-list.component'; 11 | 12 | @NgModule({ 13 | declarations: [ 14 | AppComponent, 15 | AddTutorialComponent, 16 | TutorialDetailsComponent, 17 | TutorialsListComponent 18 | ], 19 | imports: [ 20 | BrowserModule, 21 | AppRoutingModule, 22 | FormsModule, 23 | HttpClientModule 24 | ], 25 | providers: [], 26 | bootstrap: [AppComponent] 27 | }) 28 | export class AppModule { } 29 | -------------------------------------------------------------------------------- /angular-8-client/src/app/components/add-tutorial/add-tutorial.component.css: -------------------------------------------------------------------------------- 1 | .submit-form { 2 | max-width: 300px; 3 | margin: auto; 4 | } -------------------------------------------------------------------------------- /angular-8-client/src/app/components/add-tutorial/add-tutorial.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 13 |
14 | 15 |
16 | 17 | 24 |
25 | 26 | 27 |
28 | 29 |
30 |

You submitted successfully!

31 | 32 |
33 |
34 | -------------------------------------------------------------------------------- /angular-8-client/src/app/components/add-tutorial/add-tutorial.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AddTutorialComponent } from './add-tutorial.component'; 4 | 5 | describe('AddTutorialComponent', () => { 6 | let component: AddTutorialComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AddTutorialComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AddTutorialComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /angular-8-client/src/app/components/add-tutorial/add-tutorial.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { TutorialService } from 'src/app/services/tutorial.service'; 3 | 4 | @Component({ 5 | selector: 'app-add-tutorial', 6 | templateUrl: './add-tutorial.component.html', 7 | styleUrls: ['./add-tutorial.component.css'] 8 | }) 9 | export class AddTutorialComponent implements OnInit { 10 | tutorial = { 11 | title: '', 12 | description: '', 13 | published: false 14 | }; 15 | submitted = false; 16 | 17 | constructor(private tutorialService: TutorialService) { } 18 | 19 | ngOnInit() { 20 | } 21 | 22 | saveTutorial() { 23 | const data = { 24 | title: this.tutorial.title, 25 | description: this.tutorial.description 26 | }; 27 | 28 | this.tutorialService.create(data) 29 | .subscribe( 30 | response => { 31 | console.log(response); 32 | this.submitted = true; 33 | }, 34 | error => { 35 | console.log(error); 36 | }); 37 | } 38 | 39 | newTutorial() { 40 | this.submitted = false; 41 | this.tutorial = { 42 | title: '', 43 | description: '', 44 | published: false 45 | }; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /angular-8-client/src/app/components/tutorial-details/tutorial-details.component.css: -------------------------------------------------------------------------------- 1 | .edit-form { 2 | max-width: 300px; 3 | margin: auto; 4 | } -------------------------------------------------------------------------------- /angular-8-client/src/app/components/tutorial-details/tutorial-details.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Tutorial

3 |
4 |
5 | 6 | 13 |
14 |
15 | 16 | 23 |
24 | 25 |
26 | 27 | {{ currentTutorial.published ? "Published" : "Pending" }} 28 |
29 |
30 | 31 | 38 | 45 | 46 | 49 | 50 | 53 |

{{ message }}

54 |
55 | 56 |
57 |
58 |

Cannot access this Tutorial...

59 |
60 | -------------------------------------------------------------------------------- /angular-8-client/src/app/components/tutorial-details/tutorial-details.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TutorialDetailsComponent } from './tutorial-details.component'; 4 | 5 | describe('TutorialDetailsComponent', () => { 6 | let component: TutorialDetailsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TutorialDetailsComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TutorialDetailsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /angular-8-client/src/app/components/tutorial-details/tutorial-details.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { TutorialService } from 'src/app/services/tutorial.service'; 3 | import { ActivatedRoute, Router } from '@angular/router'; 4 | 5 | @Component({ 6 | selector: 'app-tutorial-details', 7 | templateUrl: './tutorial-details.component.html', 8 | styleUrls: ['./tutorial-details.component.css'] 9 | }) 10 | export class TutorialDetailsComponent implements OnInit { 11 | currentTutorial = null; 12 | message = ''; 13 | 14 | constructor( 15 | private tutorialService: TutorialService, 16 | private route: ActivatedRoute, 17 | private router: Router) { } 18 | 19 | ngOnInit() { 20 | this.message = ''; 21 | this.getTutorial(this.route.snapshot.paramMap.get('id')); 22 | } 23 | 24 | getTutorial(id) { 25 | this.tutorialService.get(id) 26 | .subscribe( 27 | data => { 28 | this.currentTutorial = data; 29 | console.log(data); 30 | }, 31 | error => { 32 | console.log(error); 33 | }); 34 | } 35 | 36 | updatePublished(status) { 37 | const data = { 38 | title: this.currentTutorial.title, 39 | description: this.currentTutorial.description, 40 | published: status 41 | }; 42 | 43 | this.tutorialService.update(this.currentTutorial.id, data) 44 | .subscribe( 45 | response => { 46 | this.currentTutorial.published = status; 47 | console.log(response); 48 | }, 49 | error => { 50 | console.log(error); 51 | }); 52 | } 53 | 54 | updateTutorial() { 55 | this.tutorialService.update(this.currentTutorial.id, this.currentTutorial) 56 | .subscribe( 57 | response => { 58 | console.log(response); 59 | this.message = 'The tutorial was updated successfully!'; 60 | }, 61 | error => { 62 | console.log(error); 63 | }); 64 | } 65 | 66 | deleteTutorial() { 67 | this.tutorialService.delete(this.currentTutorial.id) 68 | .subscribe( 69 | response => { 70 | console.log(response); 71 | this.router.navigate(['/tutorials']); 72 | }, 73 | error => { 74 | console.log(error); 75 | }); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /angular-8-client/src/app/components/tutorials-list/tutorials-list.component.css: -------------------------------------------------------------------------------- 1 | .list { 2 | text-align: left; 3 | max-width: 750px; 4 | margin: auto; 5 | } -------------------------------------------------------------------------------- /angular-8-client/src/app/components/tutorials-list/tutorials-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 10 |
11 | 18 |
19 |
20 |
21 |
22 |

Tutorials List

23 |
    24 |
  • 30 | {{ tutorial.title }} 31 |
  • 32 |
33 | 34 | 37 |
38 |
39 |
40 |

Tutorial

41 |
42 | {{ currentTutorial.title }} 43 |
44 |
45 | 46 | {{ currentTutorial.description }} 47 |
48 |
49 | 50 | {{ currentTutorial.published ? "Published" : "Pending" }} 51 |
52 | 53 | 54 | Edit 55 | 56 |
57 | 58 |
59 |
60 |

Please click on a Tutorial...

61 |
62 |
63 |
64 | -------------------------------------------------------------------------------- /angular-8-client/src/app/components/tutorials-list/tutorials-list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TutorialsListComponent } from './tutorials-list.component'; 4 | 5 | describe('TutorialsListComponent', () => { 6 | let component: TutorialsListComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TutorialsListComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TutorialsListComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /angular-8-client/src/app/components/tutorials-list/tutorials-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { TutorialService } from 'src/app/services/tutorial.service'; 3 | 4 | @Component({ 5 | selector: 'app-tutorials-list', 6 | templateUrl: './tutorials-list.component.html', 7 | styleUrls: ['./tutorials-list.component.css'] 8 | }) 9 | export class TutorialsListComponent implements OnInit { 10 | 11 | tutorials: any; 12 | currentTutorial = null; 13 | currentIndex = -1; 14 | title = ''; 15 | 16 | constructor(private tutorialService: TutorialService) { } 17 | 18 | ngOnInit() { 19 | this.retrieveTutorials(); 20 | } 21 | 22 | retrieveTutorials() { 23 | this.tutorialService.getAll() 24 | .subscribe( 25 | data => { 26 | this.tutorials = data; 27 | console.log(data); 28 | }, 29 | error => { 30 | console.log(error); 31 | }); 32 | } 33 | 34 | refreshList() { 35 | this.retrieveTutorials(); 36 | this.currentTutorial = null; 37 | this.currentIndex = -1; 38 | } 39 | 40 | setActiveTutorial(tutorial, index) { 41 | this.currentTutorial = tutorial; 42 | this.currentIndex = index; 43 | } 44 | 45 | removeAllTutorials() { 46 | this.tutorialService.deleteAll() 47 | .subscribe( 48 | response => { 49 | console.log(response); 50 | this.refreshList(); 51 | }, 52 | error => { 53 | console.log(error); 54 | }); 55 | } 56 | 57 | searchTitle() { 58 | this.tutorialService.findByTitle(this.title) 59 | .subscribe( 60 | data => { 61 | this.tutorials = data; 62 | console.log(data); 63 | }, 64 | error => { 65 | console.log(error); 66 | }); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /angular-8-client/src/app/services/tutorial.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { TutorialService } from './tutorial.service'; 4 | 5 | describe('TutorialService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: TutorialService = TestBed.get(TutorialService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /angular-8-client/src/app/services/tutorial.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | 4 | const baseUrl = 'http://localhost:8080/api/tutorials'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class TutorialService { 10 | 11 | constructor(private http: HttpClient) { } 12 | 13 | getAll() { 14 | return this.http.get(baseUrl); 15 | } 16 | 17 | get(id) { 18 | return this.http.get(`${baseUrl}/${id}`); 19 | } 20 | 21 | create(data) { 22 | return this.http.post(baseUrl, data); 23 | } 24 | 25 | update(id, data) { 26 | return this.http.put(`${baseUrl}/${id}`, data); 27 | } 28 | 29 | delete(id) { 30 | return this.http.delete(`${baseUrl}/${id}`); 31 | } 32 | 33 | deleteAll() { 34 | return this.http.delete(baseUrl); 35 | } 36 | 37 | findByTitle(title) { 38 | return this.http.get(`${baseUrl}?title=${title}`); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /angular-8-client/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bezkoder/spring-boot-angular-8-crud-example/4c8538075f67ec3dc04af6ee0da1173ef9304166/angular-8-client/src/assets/.gitkeep -------------------------------------------------------------------------------- /angular-8-client/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /angular-8-client/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /angular-8-client/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bezkoder/spring-boot-angular-8-crud-example/4c8538075f67ec3dc04af6ee0da1173ef9304166/angular-8-client/src/favicon.ico -------------------------------------------------------------------------------- /angular-8-client/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular8ClientCrud 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /angular-8-client/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /angular-8-client/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags.ts'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | /*************************************************************************************************** 56 | * Zone JS is required by default for Angular itself. 57 | */ 58 | import 'zone.js/dist/zone'; // Included with Angular CLI. 59 | 60 | 61 | /*************************************************************************************************** 62 | * APPLICATION IMPORTS 63 | */ 64 | -------------------------------------------------------------------------------- /angular-8-client/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /angular-8-client/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /angular-8-client/static/3rdpartylicenses.txt: -------------------------------------------------------------------------------- 1 | @angular-devkit/build-angular 2 | MIT 3 | The MIT License 4 | 5 | Copyright (c) 2017 Google, Inc. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | 25 | 26 | @angular/common 27 | MIT 28 | 29 | @angular/core 30 | MIT 31 | 32 | @angular/forms 33 | MIT 34 | 35 | @angular/platform-browser 36 | MIT 37 | 38 | @angular/router 39 | MIT 40 | 41 | core-js 42 | MIT 43 | Copyright (c) 2014-2020 Denis Pushkarev 44 | 45 | Permission is hereby granted, free of charge, to any person obtaining a copy 46 | of this software and associated documentation files (the "Software"), to deal 47 | in the Software without restriction, including without limitation the rights 48 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 49 | copies of the Software, and to permit persons to whom the Software is 50 | furnished to do so, subject to the following conditions: 51 | 52 | The above copyright notice and this permission notice shall be included in 53 | all copies or substantial portions of the Software. 54 | 55 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 56 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 57 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 58 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 59 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 60 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 61 | THE SOFTWARE. 62 | 63 | 64 | regenerator-runtime 65 | MIT 66 | MIT License 67 | 68 | Copyright (c) 2014-present, Facebook, Inc. 69 | 70 | Permission is hereby granted, free of charge, to any person obtaining a copy 71 | of this software and associated documentation files (the "Software"), to deal 72 | in the Software without restriction, including without limitation the rights 73 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 74 | copies of the Software, and to permit persons to whom the Software is 75 | furnished to do so, subject to the following conditions: 76 | 77 | The above copyright notice and this permission notice shall be included in all 78 | copies or substantial portions of the Software. 79 | 80 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 81 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 82 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 83 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 84 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 85 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 86 | SOFTWARE. 87 | 88 | 89 | rxjs 90 | Apache-2.0 91 | Apache License 92 | Version 2.0, January 2004 93 | http://www.apache.org/licenses/ 94 | 95 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 96 | 97 | 1. Definitions. 98 | 99 | "License" shall mean the terms and conditions for use, reproduction, 100 | and distribution as defined by Sections 1 through 9 of this document. 101 | 102 | "Licensor" shall mean the copyright owner or entity authorized by 103 | the copyright owner that is granting the License. 104 | 105 | "Legal Entity" shall mean the union of the acting entity and all 106 | other entities that control, are controlled by, or are under common 107 | control with that entity. For the purposes of this definition, 108 | "control" means (i) the power, direct or indirect, to cause the 109 | direction or management of such entity, whether by contract or 110 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 111 | outstanding shares, or (iii) beneficial ownership of such entity. 112 | 113 | "You" (or "Your") shall mean an individual or Legal Entity 114 | exercising permissions granted by this License. 115 | 116 | "Source" form shall mean the preferred form for making modifications, 117 | including but not limited to software source code, documentation 118 | source, and configuration files. 119 | 120 | "Object" form shall mean any form resulting from mechanical 121 | transformation or translation of a Source form, including but 122 | not limited to compiled object code, generated documentation, 123 | and conversions to other media types. 124 | 125 | "Work" shall mean the work of authorship, whether in Source or 126 | Object form, made available under the License, as indicated by a 127 | copyright notice that is included in or attached to the work 128 | (an example is provided in the Appendix below). 129 | 130 | "Derivative Works" shall mean any work, whether in Source or Object 131 | form, that is based on (or derived from) the Work and for which the 132 | editorial revisions, annotations, elaborations, or other modifications 133 | represent, as a whole, an original work of authorship. For the purposes 134 | of this License, Derivative Works shall not include works that remain 135 | separable from, or merely link (or bind by name) to the interfaces of, 136 | the Work and Derivative Works thereof. 137 | 138 | "Contribution" shall mean any work of authorship, including 139 | the original version of the Work and any modifications or additions 140 | to that Work or Derivative Works thereof, that is intentionally 141 | submitted to Licensor for inclusion in the Work by the copyright owner 142 | or by an individual or Legal Entity authorized to submit on behalf of 143 | the copyright owner. For the purposes of this definition, "submitted" 144 | means any form of electronic, verbal, or written communication sent 145 | to the Licensor or its representatives, including but not limited to 146 | communication on electronic mailing lists, source code control systems, 147 | and issue tracking systems that are managed by, or on behalf of, the 148 | Licensor for the purpose of discussing and improving the Work, but 149 | excluding communication that is conspicuously marked or otherwise 150 | designated in writing by the copyright owner as "Not a Contribution." 151 | 152 | "Contributor" shall mean Licensor and any individual or Legal Entity 153 | on behalf of whom a Contribution has been received by Licensor and 154 | subsequently incorporated within the Work. 155 | 156 | 2. Grant of Copyright License. Subject to the terms and conditions of 157 | this License, each Contributor hereby grants to You a perpetual, 158 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 159 | copyright license to reproduce, prepare Derivative Works of, 160 | publicly display, publicly perform, sublicense, and distribute the 161 | Work and such Derivative Works in Source or Object form. 162 | 163 | 3. Grant of Patent License. Subject to the terms and conditions of 164 | this License, each Contributor hereby grants to You a perpetual, 165 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 166 | (except as stated in this section) patent license to make, have made, 167 | use, offer to sell, sell, import, and otherwise transfer the Work, 168 | where such license applies only to those patent claims licensable 169 | by such Contributor that are necessarily infringed by their 170 | Contribution(s) alone or by combination of their Contribution(s) 171 | with the Work to which such Contribution(s) was submitted. If You 172 | institute patent litigation against any entity (including a 173 | cross-claim or counterclaim in a lawsuit) alleging that the Work 174 | or a Contribution incorporated within the Work constitutes direct 175 | or contributory patent infringement, then any patent licenses 176 | granted to You under this License for that Work shall terminate 177 | as of the date such litigation is filed. 178 | 179 | 4. Redistribution. You may reproduce and distribute copies of the 180 | Work or Derivative Works thereof in any medium, with or without 181 | modifications, and in Source or Object form, provided that You 182 | meet the following conditions: 183 | 184 | (a) You must give any other recipients of the Work or 185 | Derivative Works a copy of this License; and 186 | 187 | (b) You must cause any modified files to carry prominent notices 188 | stating that You changed the files; and 189 | 190 | (c) You must retain, in the Source form of any Derivative Works 191 | that You distribute, all copyright, patent, trademark, and 192 | attribution notices from the Source form of the Work, 193 | excluding those notices that do not pertain to any part of 194 | the Derivative Works; and 195 | 196 | (d) If the Work includes a "NOTICE" text file as part of its 197 | distribution, then any Derivative Works that You distribute must 198 | include a readable copy of the attribution notices contained 199 | within such NOTICE file, excluding those notices that do not 200 | pertain to any part of the Derivative Works, in at least one 201 | of the following places: within a NOTICE text file distributed 202 | as part of the Derivative Works; within the Source form or 203 | documentation, if provided along with the Derivative Works; or, 204 | within a display generated by the Derivative Works, if and 205 | wherever such third-party notices normally appear. The contents 206 | of the NOTICE file are for informational purposes only and 207 | do not modify the License. You may add Your own attribution 208 | notices within Derivative Works that You distribute, alongside 209 | or as an addendum to the NOTICE text from the Work, provided 210 | that such additional attribution notices cannot be construed 211 | as modifying the License. 212 | 213 | You may add Your own copyright statement to Your modifications and 214 | may provide additional or different license terms and conditions 215 | for use, reproduction, or distribution of Your modifications, or 216 | for any such Derivative Works as a whole, provided Your use, 217 | reproduction, and distribution of the Work otherwise complies with 218 | the conditions stated in this License. 219 | 220 | 5. Submission of Contributions. Unless You explicitly state otherwise, 221 | any Contribution intentionally submitted for inclusion in the Work 222 | by You to the Licensor shall be under the terms and conditions of 223 | this License, without any additional terms or conditions. 224 | Notwithstanding the above, nothing herein shall supersede or modify 225 | the terms of any separate license agreement you may have executed 226 | with Licensor regarding such Contributions. 227 | 228 | 6. Trademarks. This License does not grant permission to use the trade 229 | names, trademarks, service marks, or product names of the Licensor, 230 | except as required for reasonable and customary use in describing the 231 | origin of the Work and reproducing the content of the NOTICE file. 232 | 233 | 7. Disclaimer of Warranty. Unless required by applicable law or 234 | agreed to in writing, Licensor provides the Work (and each 235 | Contributor provides its Contributions) on an "AS IS" BASIS, 236 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 237 | implied, including, without limitation, any warranties or conditions 238 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 239 | PARTICULAR PURPOSE. You are solely responsible for determining the 240 | appropriateness of using or redistributing the Work and assume any 241 | risks associated with Your exercise of permissions under this License. 242 | 243 | 8. Limitation of Liability. In no event and under no legal theory, 244 | whether in tort (including negligence), contract, or otherwise, 245 | unless required by applicable law (such as deliberate and grossly 246 | negligent acts) or agreed to in writing, shall any Contributor be 247 | liable to You for damages, including any direct, indirect, special, 248 | incidental, or consequential damages of any character arising as a 249 | result of this License or out of the use or inability to use the 250 | Work (including but not limited to damages for loss of goodwill, 251 | work stoppage, computer failure or malfunction, or any and all 252 | other commercial damages or losses), even if such Contributor 253 | has been advised of the possibility of such damages. 254 | 255 | 9. Accepting Warranty or Additional Liability. While redistributing 256 | the Work or Derivative Works thereof, You may choose to offer, 257 | and charge a fee for, acceptance of support, warranty, indemnity, 258 | or other liability obligations and/or rights consistent with this 259 | License. However, in accepting such obligations, You may act only 260 | on Your own behalf and on Your sole responsibility, not on behalf 261 | of any other Contributor, and only if You agree to indemnify, 262 | defend, and hold each Contributor harmless for any liability 263 | incurred by, or claims asserted against, such Contributor by reason 264 | of your accepting any such warranty or additional liability. 265 | 266 | END OF TERMS AND CONDITIONS 267 | 268 | APPENDIX: How to apply the Apache License to your work. 269 | 270 | To apply the Apache License to your work, attach the following 271 | boilerplate notice, with the fields enclosed by brackets "[]" 272 | replaced with your own identifying information. (Don't include 273 | the brackets!) The text should be enclosed in the appropriate 274 | comment syntax for the file format. We also recommend that a 275 | file or class name and description of purpose be included on the 276 | same "printed page" as the copyright notice for easier 277 | identification within third-party archives. 278 | 279 | Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors 280 | 281 | Licensed under the Apache License, Version 2.0 (the "License"); 282 | you may not use this file except in compliance with the License. 283 | You may obtain a copy of the License at 284 | 285 | http://www.apache.org/licenses/LICENSE-2.0 286 | 287 | Unless required by applicable law or agreed to in writing, software 288 | distributed under the License is distributed on an "AS IS" BASIS, 289 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 290 | See the License for the specific language governing permissions and 291 | limitations under the License. 292 | 293 | 294 | 295 | zone.js 296 | MIT 297 | The MIT License 298 | 299 | Copyright (c) 2016-2018 Google, Inc. 300 | 301 | Permission is hereby granted, free of charge, to any person obtaining a copy 302 | of this software and associated documentation files (the "Software"), to deal 303 | in the Software without restriction, including without limitation the rights 304 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 305 | copies of the Software, and to permit persons to whom the Software is 306 | furnished to do so, subject to the following conditions: 307 | 308 | The above copyright notice and this permission notice shall be included in 309 | all copies or substantial portions of the Software. 310 | 311 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 312 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 313 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 314 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 315 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 316 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 317 | THE SOFTWARE. 318 | -------------------------------------------------------------------------------- /angular-8-client/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bezkoder/spring-boot-angular-8-crud-example/4c8538075f67ec3dc04af6ee0da1173ef9304166/angular-8-client/static/favicon.ico -------------------------------------------------------------------------------- /angular-8-client/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular8ClientCrud 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /angular-8-client/static/polyfills-es2015.5b10b8fd823b6392f1fd.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[2],{2:function(e,t,n){e.exports=n("hN/g")},"hN/g":function(e,t,n){"use strict";n.r(t),n("pDpN")},pDpN:function(e,t){!function(e){const t=e.performance;function n(e){t&&t.mark&&t.mark(e)}function o(e,n){t&&t.measure&&t.measure(e,n)}n("Zone");const r=!0===e.__zone_symbol__forceDuplicateZoneCheck;if(e.Zone){if(r||"function"!=typeof e.Zone.__symbol__)throw new Error("Zone already loaded.");return e.Zone}class s{constructor(e,t){this._parent=e,this._name=t?t.name||"unnamed":"",this._properties=t&&t.properties||{},this._zoneDelegate=new a(this,this._parent&&this._parent._zoneDelegate,t)}static assertZonePatched(){if(e.Promise!==D.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let e=s.current;for(;e.parent;)e=e.parent;return e}static get current(){return P.zone}static get currentTask(){return O}static __load_patch(t,i){if(D.hasOwnProperty(t)){if(r)throw Error("Already loaded patch: "+t)}else if(!e["__Zone_disable_"+t]){const r="Zone:"+t;n(r),D[t]=i(e,s,z),o(r,r)}}get parent(){return this._parent}get name(){return this._name}get(e){const t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const n=this._zoneDelegate.intercept(this,e,t),o=this;return function(){return o.runGuarded(n,this,arguments,t)}}run(e,t,n,o){P={parent:P,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,o)}finally{P=P.parent}}runGuarded(e,t=null,n,o){P={parent:P,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,o)}catch(r){if(this._zoneDelegate.handleError(this,r))throw r}}finally{P=P.parent}}runTask(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||m).name+"; Execution: "+this.name+")");if(e.state===k&&(e.type===S||e.type===Z))return;const o=e.state!=v;o&&e._transitionTo(v,b),e.runCount++;const r=O;O=e,P={parent:P,zone:this};try{e.type==Z&&e.data&&!e.data.isPeriodic&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(s){if(this._zoneDelegate.handleError(this,s))throw s}}finally{e.state!==k&&e.state!==w&&(e.type==S||e.data&&e.data.isPeriodic?o&&e._transitionTo(b,v):(e.runCount=0,this._updateTaskCount(e,-1),o&&e._transitionTo(k,v,k))),P=P.parent,O=r}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(y,k);const t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(n){throw e._transitionTo(w,y,k),this._zoneDelegate.handleError(this,n),n}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==y&&e._transitionTo(b,y),e}scheduleMicroTask(e,t,n,o){return this.scheduleTask(new c(E,e,t,n,o,void 0))}scheduleMacroTask(e,t,n,o,r){return this.scheduleTask(new c(Z,e,t,n,o,r))}scheduleEventTask(e,t,n,o,r){return this.scheduleTask(new c(S,e,t,n,o,r))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||m).name+"; Execution: "+this.name+")");e._transitionTo(T,b,v);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(w,T),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(k,T),e.runCount=0,e}_updateTaskCount(e,t){const n=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(let o=0;oe.hasTask(n,o),onScheduleTask:(e,t,n,o)=>e.scheduleTask(n,o),onInvokeTask:(e,t,n,o,r,s)=>e.invokeTask(n,o,r,s),onCancelTask:(e,t,n,o)=>e.cancelTask(n,o)};class a{constructor(e,t,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this.zone:t.zone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this.zone:t.zone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this.zone:t.zone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this.zone:t.zone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this.zone:t.zone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this.zone:t.zone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this.zone:t.zone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const o=n&&n.onHasTask;(o||t&&t._hasTaskZS)&&(this._hasTaskZS=o?n:i,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=e,n.onScheduleTask||(this._scheduleTaskZS=i,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this.zone),n.onInvokeTask||(this._invokeTaskZS=i,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this.zone),n.onCancelTask||(this._cancelTaskZS=i,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this.zone))}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new s(e,t)}intercept(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t}invoke(e,t,n,o,r){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,o,r):t.apply(n,o)}handleError(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)}scheduleTask(e,t){let n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=E)throw new Error("Task is missing scheduleFn.");g(t)}return n}invokeTask(e,t,n,o){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,o):t.callback.apply(n,o)}cancelTask(e,t){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");n=t.cancelFn(t)}return n}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(n){this.handleError(e,n)}}_updateTaskCount(e,t){const n=this._taskCounts,o=n[e],r=n[e]=o+t;if(r<0)throw new Error("More tasks executed then were scheduled.");0!=o&&0!=r||this.hasTask(this.zone,{microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e})}}class c{constructor(t,n,o,r,s,i){this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=t,this.source=n,this.data=r,this.scheduleFn=s,this.cancelFn=i,this.callback=o;const a=this;this.invoke=t===S&&r&&r.useG?c.invokeTask:function(){return c.invokeTask.call(e,a,this,arguments)}}static invokeTask(e,t,n){e||(e=this),j++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==j&&_(),j--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(k,y)}_transitionTo(e,t,n){if(this._state!==t&&this._state!==n)throw new Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${n?" or '"+n+"'":""}, was '${this._state}'.`);this._state=e,e==k&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const l=I("setTimeout"),u=I("Promise"),h=I("then");let p,f=[],d=!1;function g(t){if(0===j&&0===f.length)if(p||e[u]&&(p=e[u].resolve(0)),p){let e=p[h];e||(e=p.then),e.call(p,_)}else e[l](_,0);t&&f.push(t)}function _(){if(!d){for(d=!0;f.length;){const t=f;f=[];for(let n=0;nP,onUnhandledError:C,microtaskDrainDone:C,scheduleMicroTask:g,showUncaughtError:()=>!s[I("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:C,patchMethod:()=>C,bindArguments:()=>[],patchThen:()=>C,patchMacroTask:()=>C,setNativePromise:e=>{e&&"function"==typeof e.resolve&&(p=e.resolve(0))},patchEventPrototype:()=>C,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>C,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>C,wrapWithCurrentZone:()=>C,filterProperties:()=>[],attachOriginToPatched:()=>C,_redefineProperty:()=>C,patchCallbacks:()=>C};let P={parent:null,zone:new s(null,null)},O=null,j=0;function C(){}function I(e){return"__zone_symbol__"+e}o("Zone","Zone"),e.Zone=s}("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global),Zone.__load_patch("ZoneAwarePromise",(e,t,n)=>{const o=Object.getOwnPropertyDescriptor,r=Object.defineProperty,s=n.symbol,i=[],a=s("Promise"),c=s("then");n.onUnhandledError=e=>{if(n.showUncaughtError()){const t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=()=>{for(;i.length;)for(;i.length;){const t=i.shift();try{t.zone.runGuarded(()=>{throw t})}catch(e){u(e)}}};const l=s("unhandledPromiseRejectionHandler");function u(e){n.onUnhandledError(e);try{const n=t[l];n&&"function"==typeof n&&n.call(this,e)}catch(o){}}function h(e){return e&&e.then}function p(e){return e}function f(e){return Z.reject(e)}const d=s("state"),g=s("value"),_=s("finally"),m=s("parentPromiseValue"),k=s("parentPromiseState");function y(e,t){return n=>{try{v(e,t,n)}catch(o){v(e,!1,o)}}}const b=s("currentTaskTrace");function v(e,o,s){const a=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}}();if(e===s)throw new TypeError("Promise resolved with itself");if(null===e[d]){let u=null;try{"object"!=typeof s&&"function"!=typeof s||(u=s&&s.then)}catch(l){return a(()=>{v(e,!1,l)})(),e}if(!1!==o&&s instanceof Z&&s.hasOwnProperty(d)&&s.hasOwnProperty(g)&&null!==s[d])w(s),v(e,s[d],s[g]);else if(!1!==o&&"function"==typeof u)try{u.call(s,a(y(e,o)),a(y(e,!1)))}catch(l){a(()=>{v(e,!1,l)})()}else{e[d]=o;const a=e[g];if(e[g]=s,e[_]===_&&!0===o&&(e[d]=e[k],e[g]=e[m]),!1===o&&s instanceof Error){const e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&r(s,b,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t{try{const o=e[g],r=n&&_===n[_];r&&(n[m]=o,n[k]=s);const a=t.run(i,void 0,r&&i!==f&&i!==p?[]:[o]);v(n,!0,a)}catch(o){v(n,!1,o)}},n)}class Z{constructor(e){const t=this;if(!(t instanceof Z))throw new Error("Must be an instanceof Promise.");t[d]=null,t[g]=[];try{e&&e(y(t,!0),y(t,!1))}catch(n){v(t,!1,n)}}static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return v(new this(null),!0,e)}static reject(e){return v(new this(null),!1,e)}static race(e){let t,n,o=new this((e,o)=>{t=e,n=o});function r(e){t(e)}function s(e){n(e)}for(let i of e)h(i)||(i=this.resolve(i)),i.then(r,s);return o}static all(e){let t,n,o=new this((e,o)=>{t=e,n=o}),r=2,s=0;const i=[];for(let a of e){h(a)||(a=this.resolve(a));const e=s;a.then(n=>{i[e]=n,r--,0===r&&t(i)},n),r++,s++}return r-=2,0===r&&t(i),o}get[Symbol.toStringTag](){return"Promise"}then(e,n){const o=new this.constructor(null),r=t.current;return null==this[d]?this[g].push(r,o,e,n):E(this,r,o,e,n),o}catch(e){return this.then(null,e)}finally(e){const n=new this.constructor(null);n[_]=_;const o=t.current;return null==this[d]?this[g].push(o,n,e,e):E(this,o,n,e,e),n}}Z.resolve=Z.resolve,Z.reject=Z.reject,Z.race=Z.race,Z.all=Z.all;const S=e[a]=e.Promise,D=t.__symbol__("ZoneAwarePromise");let z=o(e,"Promise");z&&!z.configurable||(z&&delete z.writable,z&&delete z.value,z||(z={configurable:!0,enumerable:!0}),z.get=function(){return e[D]?e[D]:e[a]},z.set=function(t){t===Z?e[D]=t:(e[a]=t,t.prototype[c]||O(t),n.setNativePromise(t))},r(e,"Promise",z)),e.Promise=Z;const P=s("thenPatched");function O(e){const t=e.prototype,n=o(t,"then");if(n&&(!1===n.writable||!n.configurable))return;const r=t.then;t[c]=r,e.prototype.then=function(e,t){return new Z((e,t)=>{r.call(this,e,t)}).then(e,t)},e[P]=!0}if(n.patchThen=O,S){O(S);const t=e.fetch;"function"==typeof t&&(e[n.symbol("fetch")]=t,e.fetch=(j=t,function(){let e=j.apply(this,arguments);if(e instanceof Z)return e;let t=e.constructor;return t[P]||O(t),e}))}var j;return Promise[t.__symbol__("uncaughtPromiseErrors")]=i,Z});const n=Object.getOwnPropertyDescriptor,o=Object.defineProperty,r=Object.getPrototypeOf,s=Object.create,i=Array.prototype.slice,a=Zone.__symbol__("addEventListener"),c=Zone.__symbol__("removeEventListener");function l(e,t){return Zone.current.wrap(e,t)}function u(e,t,n,o,r){return Zone.current.scheduleMacroTask(e,t,n,o,r)}const h=Zone.__symbol__,p="undefined"!=typeof window,f=p?window:void 0,d=p&&f||"object"==typeof self&&self||global,g=[null];function _(e,t){for(let n=e.length-1;n>=0;n--)"function"==typeof e[n]&&(e[n]=l(e[n],t+"_"+n));return e}function m(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}const k="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,y=!("nw"in d)&&void 0!==d.process&&"[object process]"==={}.toString.call(d.process),b=!y&&!k&&!(!p||!f.HTMLElement),v=void 0!==d.process&&"[object process]"==={}.toString.call(d.process)&&!k&&!(!p||!f.HTMLElement),T={},w=function(e){if(!(e=e||d.event))return;let t=T[e.type];t||(t=T[e.type]=h("ON_PROPERTY"+e.type));const n=this||e.target||d,o=n[t];let r;if(b&&n===f&&"error"===e.type){const t=e;r=o&&o.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===r&&e.preventDefault()}else r=o&&o.apply(this,arguments),null==r||r||e.preventDefault();return r};function E(e,t,r){let s=n(e,t);if(!s&&r&&n(r,t)&&(s={enumerable:!0,configurable:!0}),!s||!s.configurable)return;const i=h("on"+t+"patched");if(e.hasOwnProperty(i)&&e[i])return;delete s.writable,delete s.value;const a=s.get,c=s.set,l=t.substr(2);let u=T[l];u||(u=T[l]=h("ON_PROPERTY"+l)),s.set=function(t){let n=this;n||e!==d||(n=d),n&&(n[u]&&n.removeEventListener(l,w),c&&c.apply(n,g),"function"==typeof t?(n[u]=t,n.addEventListener(l,w,!1)):n[u]=null)},s.get=function(){let n=this;if(n||e!==d||(n=d),!n)return null;const o=n[u];if(o)return o;if(a){let e=a&&a.call(this);if(e)return s.set.call(this,e),"function"==typeof n.removeAttribute&&n.removeAttribute(t),e}return null},o(e,t,s),e[i]=!0}function Z(e,t,n){if(t)for(let o=0;ofunction(t,o){const s=n(t,o);return s.cbIdx>=0&&"function"==typeof o[s.cbIdx]?u(s.name,o[s.cbIdx],s,r):e.apply(t,o)})}function O(e,t){e[h("OriginalDelegate")]=t}let j=!1,C=!1;function I(){try{const e=f.navigator.userAgent;if(-1!==e.indexOf("MSIE ")||-1!==e.indexOf("Trident/"))return!0}catch(e){}return!1}function L(){if(j)return C;j=!0;try{const e=f.navigator.userAgent;-1===e.indexOf("MSIE ")&&-1===e.indexOf("Trident/")&&-1===e.indexOf("Edge/")||(C=!0)}catch(e){}return C}Zone.__load_patch("toString",e=>{const t=Function.prototype.toString,n=h("OriginalDelegate"),o=h("Promise"),r=h("Error"),s=function(){if("function"==typeof this){const s=this[n];if(s)return"function"==typeof s?t.call(s):Object.prototype.toString.call(s);if(this===Promise){const n=e[o];if(n)return t.call(n)}if(this===Error){const n=e[r];if(n)return t.call(n)}}return t.call(this)};s[n]=t,Function.prototype.toString=s;const i=Object.prototype.toString;Object.prototype.toString=function(){return this instanceof Promise?"[object Promise]":i.call(this)}});let R=!1;if("undefined"!=typeof window)try{const e=Object.defineProperty({},"passive",{get:function(){R=!0}});window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(ge){R=!1}const x={useG:!0},M={},N={},A=/^__zone_symbol__(\w+)(true|false)$/;function F(e,t,n){const o=n&&n.add||"addEventListener",s=n&&n.rm||"removeEventListener",i=n&&n.listeners||"eventListeners",a=n&&n.rmAll||"removeAllListeners",c=h(o),l="."+o+":",u=function(e,t,n){if(e.isRemoved)return;const o=e.callback;"object"==typeof o&&o.handleEvent&&(e.callback=e=>o.handleEvent(e),e.originalDelegate=o),e.invoke(e,t,[n]);const r=e.options;r&&"object"==typeof r&&r.once&&t[s].call(t,n.type,e.originalDelegate?e.originalDelegate:e.callback,r)},p=function(t){if(!(t=t||e.event))return;const n=this||t.target||e,o=n[M[t.type].false];if(o)if(1===o.length)u(o[0],n,t);else{const e=o.slice();for(let o=0;ofunction(t,n){t.__zone_symbol__propagationStopped=!0,e&&e.apply(t,n)})}function q(e,t,n,o,r){const s=Zone.__symbol__(o);if(t[s])return;const i=t[s]=t[o];t[o]=function(s,a,c){return a&&a.prototype&&r.forEach((function(t){const r=`${n}.${o}::`+t,s=a.prototype;if(s.hasOwnProperty(t)){const n=e.ObjectGetOwnPropertyDescriptor(s,t);n&&n.value?(n.value=e.wrapWithCurrentZone(n.value,r),e._redefineProperty(a.prototype,t,n)):s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],r))}else s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],r))})),i.call(t,s,a,c)},e.attachOriginToPatched(t[o],i)}const B=Zone.__symbol__,$=Object[B("defineProperty")]=Object.defineProperty,U=Object[B("getOwnPropertyDescriptor")]=Object.getOwnPropertyDescriptor,W=Object.create,V=B("unconfigurables");function X(e,t,n){const o=n.configurable;return K(e,t,n=Y(e,t,n),o)}function J(e,t){return e&&e[V]&&e[V][t]}function Y(e,t,n){return Object.isFrozen(n)||(n.configurable=!0),n.configurable||(e[V]||Object.isFrozen(e)||$(e,V,{writable:!0,value:{}}),e[V]&&(e[V][t]=!0)),n}function K(e,t,n,o){try{return $(e,t,n)}catch(r){if(!n.configurable)throw r;void 0===o?delete n.configurable:n.configurable=o;try{return $(e,t,n)}catch(r){let o=null;try{o=JSON.stringify(n)}catch(r){o=n.toString()}console.log(`Attempting to configure '${t}' with descriptor '${o}' on object '${e}' and got error, giving up: ${r}`)}}}const Q=["absolutedeviceorientation","afterinput","afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","devicelight","devicemotion","deviceorientation","deviceorientationabsolute","deviceproximity","hashchange","languagechange","message","mozbeforepaint","offline","online","paint","pageshow","pagehide","popstate","rejectionhandled","storage","unhandledrejection","unload","userproximity","vrdisplyconnected","vrdisplaydisconnected","vrdisplaypresentchange"],ee=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],te=["load"],ne=["blur","error","focus","load","resize","scroll","messageerror"],oe=["bounce","finish","start"],re=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],se=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],ie=["close","error","open","message"],ae=["error","message"],ce=["abort","animationcancel","animationend","animationiteration","auxclick","beforeinput","blur","cancel","canplay","canplaythrough","change","compositionstart","compositionupdate","compositionend","cuechange","click","close","contextmenu","curechange","dblclick","drag","dragend","dragenter","dragexit","dragleave","dragover","drop","durationchange","emptied","ended","error","focus","focusin","focusout","gotpointercapture","input","invalid","keydown","keypress","keyup","load","loadstart","loadeddata","loadedmetadata","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","orientationchange","pause","play","playing","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","mozpointerlockchange","webkitpointerlockerchange","pointerlockerror","mozpointerlockerror","webkitpointerlockerror","pointermove","pointout","pointerover","pointerup","progress","ratechange","reset","resize","scroll","seeked","seeking","select","selectionchange","selectstart","show","sort","stalled","submit","suspend","timeupdate","volumechange","touchcancel","touchmove","touchstart","touchend","transitioncancel","transitionend","waiting","wheel"].concat(["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],["autocomplete","autocompleteerror"],["toggle"],["afterscriptexecute","beforescriptexecute","DOMContentLoaded","freeze","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange","visibilitychange","resume"],Q,["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],["activate","afterupdate","ariarequest","beforeactivate","beforedeactivate","beforeeditfocus","beforeupdate","cellchange","controlselect","dataavailable","datasetchanged","datasetcomplete","errorupdate","filterchange","layoutcomplete","losecapture","move","moveend","movestart","propertychange","resizeend","resizestart","rowenter","rowexit","rowsdelete","rowsinserted","command","compassneedscalibration","deactivate","help","mscontentzoom","msmanipulationstatechanged","msgesturechange","msgesturedoubletap","msgestureend","msgesturehold","msgesturestart","msgesturetap","msgotpointercapture","msinertiastart","mslostpointercapture","mspointercancel","mspointerdown","mspointerenter","mspointerhover","mspointerleave","mspointermove","mspointerout","mspointerover","mspointerup","pointerout","mssitemodejumplistitemremoved","msthumbnailclick","stop","storagecommit"]);function le(e,t,n){if(!n||0===n.length)return t;const o=n.filter(t=>t.target===e);if(!o||0===o.length)return t;const r=o[0].ignoreProperties;return t.filter(e=>-1===r.indexOf(e))}function ue(e,t,n,o){e&&Z(e,le(e,t,n),o)}function he(e,t){if(y&&!v)return;if(Zone[e.symbol("patchEvents")])return;const n="undefined"!=typeof WebSocket,o=t.__Zone_ignore_on_properties;if(b){const e=window,t=I?[{target:e,ignoreProperties:["error"]}]:[];ue(e,ce.concat(["messageerror"]),o?o.concat(t):o,r(e)),ue(Document.prototype,ce,o),void 0!==e.SVGElement&&ue(e.SVGElement.prototype,ce,o),ue(Element.prototype,ce,o),ue(HTMLElement.prototype,ce,o),ue(HTMLMediaElement.prototype,ee,o),ue(HTMLFrameSetElement.prototype,Q.concat(ne),o),ue(HTMLBodyElement.prototype,Q.concat(ne),o),ue(HTMLFrameElement.prototype,te,o),ue(HTMLIFrameElement.prototype,te,o);const n=e.HTMLMarqueeElement;n&&ue(n.prototype,oe,o);const s=e.Worker;s&&ue(s.prototype,ae,o)}const s=t.XMLHttpRequest;s&&ue(s.prototype,re,o);const i=t.XMLHttpRequestEventTarget;i&&ue(i&&i.prototype,re,o),"undefined"!=typeof IDBIndex&&(ue(IDBIndex.prototype,se,o),ue(IDBRequest.prototype,se,o),ue(IDBOpenDBRequest.prototype,se,o),ue(IDBDatabase.prototype,se,o),ue(IDBTransaction.prototype,se,o),ue(IDBCursor.prototype,se,o)),n&&ue(WebSocket.prototype,ie,o)}Zone.__load_patch("util",(e,t,r)=>{r.patchOnProperties=Z,r.patchMethod=z,r.bindArguments=_,r.patchMacroTask=P;const a=t.__symbol__("BLACK_LISTED_EVENTS"),c=t.__symbol__("UNPATCHED_EVENTS");e[c]&&(e[a]=e[c]),e[a]&&(t[a]=t[c]=e[a]),r.patchEventPrototype=G,r.patchEventTarget=F,r.isIEOrEdge=L,r.ObjectDefineProperty=o,r.ObjectGetOwnPropertyDescriptor=n,r.ObjectCreate=s,r.ArraySlice=i,r.patchClass=D,r.wrapWithCurrentZone=l,r.filterProperties=le,r.attachOriginToPatched=O,r._redefineProperty=X,r.patchCallbacks=q,r.getGlobalObjects=()=>({globalSources:N,zoneSymbolEventNames:M,eventNames:ce,isBrowser:b,isMix:v,isNode:y,TRUE_STR:"true",FALSE_STR:"false",ZONE_SYMBOL_PREFIX:"__zone_symbol__",ADD_EVENT_LISTENER_STR:"addEventListener",REMOVE_EVENT_LISTENER_STR:"removeEventListener"})});const pe=h("zoneTask");function fe(e,t,n,o){let r=null,s=null;n+=o;const i={};function a(t){const n=t.data;return n.args[0]=function(){try{t.invoke.apply(this,arguments)}finally{t.data&&t.data.isPeriodic||("number"==typeof n.handleId?delete i[n.handleId]:n.handleId&&(n.handleId[pe]=null))}},n.handleId=r.apply(e,n.args),t}function c(e){return s(e.data.handleId)}r=z(e,t+=o,n=>function(r,s){if("function"==typeof s[0]){const e=u(t,s[0],{isPeriodic:"Interval"===o,delay:"Timeout"===o||"Interval"===o?s[1]||0:void 0,args:s},a,c);if(!e)return e;const n=e.data.handleId;return"number"==typeof n?i[n]=e:n&&(n[pe]=e),n&&n.ref&&n.unref&&"function"==typeof n.ref&&"function"==typeof n.unref&&(e.ref=n.ref.bind(n),e.unref=n.unref.bind(n)),"number"==typeof n||n?n:e}return n.apply(e,s)}),s=z(e,n,t=>function(n,o){const r=o[0];let s;"number"==typeof r?s=i[r]:(s=r&&r[pe],s||(s=r)),s&&"string"==typeof s.type?"notScheduled"!==s.state&&(s.cancelFn&&s.data.isPeriodic||0===s.runCount)&&("number"==typeof r?delete i[r]:r&&(r[pe]=null),s.zone.cancelTask(s)):t.apply(e,o)})}function de(e,t){if(Zone[t.symbol("patchEventTarget")])return;const{eventNames:n,zoneSymbolEventNames:o,TRUE_STR:r,FALSE_STR:s,ZONE_SYMBOL_PREFIX:i}=t.getGlobalObjects();for(let c=0;c{const t=e[Zone.__symbol__("legacyPatch")];t&&t()}),Zone.__load_patch("timers",e=>{fe(e,"set","clear","Timeout"),fe(e,"set","clear","Interval"),fe(e,"set","clear","Immediate")}),Zone.__load_patch("requestAnimationFrame",e=>{fe(e,"request","cancel","AnimationFrame"),fe(e,"mozRequest","mozCancel","AnimationFrame"),fe(e,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",(e,t)=>{const n=["alert","prompt","confirm"];for(let o=0;ofunction(o,s){return t.current.run(n,e,s,r)})}),Zone.__load_patch("EventTarget",(e,t,n)=>{!function(e,t){t.patchEventPrototype(e,t)}(e,n),de(e,n);const o=e.XMLHttpRequestEventTarget;o&&o.prototype&&n.patchEventTarget(e,[o.prototype]),D("MutationObserver"),D("WebKitMutationObserver"),D("IntersectionObserver"),D("FileReader")}),Zone.__load_patch("on_property",(e,t,n)=>{he(n,e),Object.defineProperty=function(e,t,n){if(J(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);const o=n.configurable;return"prototype"!==t&&(n=Y(e,t,n)),K(e,t,n,o)},Object.defineProperties=function(e,t){return Object.keys(t).forEach((function(n){Object.defineProperty(e,n,t[n])})),e},Object.create=function(e,t){return"object"!=typeof t||Object.isFrozen(t)||Object.keys(t).forEach((function(n){t[n]=Y(e,n,t[n])})),W(e,t)},Object.getOwnPropertyDescriptor=function(e,t){const n=U(e,t);return n&&J(e,t)&&(n.configurable=!1),n}}),Zone.__load_patch("customElements",(e,t,n)=>{!function(e,t){const{isBrowser:n,isMix:o}=t.getGlobalObjects();(n||o)&&e.customElements&&"customElements"in e&&t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback"])}(e,n)}),Zone.__load_patch("XHR",(e,t)=>{!function(e){const p=e.XMLHttpRequest;if(!p)return;const f=p.prototype;let d=f[a],g=f[c];if(!d){const t=e.XMLHttpRequestEventTarget;if(t){const e=t.prototype;d=e[a],g=e[c]}}function _(e){const t=e.data,o=t.target;o[s]=!1,o[l]=!1;const i=o[r];d||(d=o[a],g=o[c]),i&&g.call(o,"readystatechange",i);const u=o[r]=()=>{if(o.readyState===o.DONE)if(!t.aborted&&o[s]&&"scheduled"===e.state){const n=o.__zone_symbol__loadfalse;if(n&&n.length>0){const r=e.invoke;e.invoke=function(){const n=o.__zone_symbol__loadfalse;for(let t=0;tfunction(e,t){return e[o]=0==t[2],e[i]=t[1],y.apply(e,t)}),b=h("fetchTaskAborting"),v=h("fetchTaskScheduling"),T=z(f,"send",()=>function(e,n){if(!0===t.current[v])return T.apply(e,n);if(e[o])return T.apply(e,n);{const t={target:e,url:e[i],isPeriodic:!1,args:n,aborted:!1},o=u("XMLHttpRequest.send",m,t,_,k);e&&!0===e[l]&&!t.aborted&&"scheduled"===o.state&&o.invoke()}}),w=z(f,"abort",()=>function(e,o){const r=e[n];if(r&&"string"==typeof r.type){if(null==r.cancelFn||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}else if(!0===t.current[b])return w.apply(e,o)})}(e);const n=h("xhrTask"),o=h("xhrSync"),r=h("xhrListener"),s=h("xhrScheduled"),i=h("xhrURL"),l=h("xhrErrorBeforeScheduled")}),Zone.__load_patch("geolocation",e=>{e.navigator&&e.navigator.geolocation&&function(e,t){const o=e.constructor.name;for(let r=0;r{const t=function(){return e.apply(this,_(arguments,o+"."+s))};return O(t,e),t})(i)}}}(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("PromiseRejectionEvent",(e,t)=>{function n(t){return function(n){H(e,t).forEach(o=>{const r=e.PromiseRejectionEvent;if(r){const e=new r(t,{promise:n.promise,reason:n.rejection});o.invoke(e)}})}}e.PromiseRejectionEvent&&(t[h("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),t[h("rejectionHandledHandler")]=n("rejectionhandled"))})}},[[2,0]]]); -------------------------------------------------------------------------------- /angular-8-client/static/runtime-es2015.c5fa8325f89fc516600b.js: -------------------------------------------------------------------------------- 1 | !function(e){function r(r){for(var n,l,f=r[0],i=r[1],p=r[2],c=0,s=[];c [Spring Boot JPA + H2 example: Build a CRUD Rest APIs](https://bezkoder.com/spring-boot-jpa-h2-example/) 5 | 6 | In this tutorial, we're gonna build a Spring Boot Rest CRUD API example with Maven that use Spring Data JPA to interact with H2 database. You'll know: 7 | 8 | - How to configure Spring Data, JPA, Hibernate to work with Database 9 | - How to define Data Models and Repository interfaces 10 | - Way to create Spring Rest Controller to process HTTP requests 11 | - Way to use Spring Data JPA to interact with H2 Database 12 | 13 | Front-end that works well with this Back-end 14 | > [Angular 8 Client](https://bezkoder.com/angular-crud-app/) 15 | 16 | > [Angular 10 Client](https://bezkoder.com/angular-10-crud-app/) 17 | 18 | > [Angular 11 Client](https://bezkoder.com/angular-11-crud-app/) 19 | 20 | > [Vue 2 Client](https://bezkoder.com/vue-js-crud-app/) 21 | 22 | > [Vue 3 Client](https://bezkoder.com/vue-3-crud/) 23 | 24 | > [Vuetify Client](https://bezkoder.com/vuetify-data-table-example/) 25 | 26 | > [React Client](https://bezkoder.com/react-crud-web-api/) 27 | 28 | > [React Redux Client](https://bezkoder.com/react-redux-crud-example/) 29 | 30 | More Practice: 31 | > [Spring Boot File upload example with Multipart File](https://bezkoder.com/spring-boot-file-upload/) 32 | 33 | > [Spring Boot Pagination & Filter example | Spring JPA, Pageable](https://bezkoder.com/spring-boot-pagination-filter-jpa-pageable/) 34 | 35 | > [Spring Data JPA Sort/Order by multiple Columns | Spring Boot](https://bezkoder.com/spring-data-sort-multiple-columns/) 36 | 37 | > [Spring Boot Repository Unit Test with @DataJpaTest](https://bezkoder.com/spring-boot-unit-test-jpa-repo-datajpatest/) 38 | 39 | > [Deploy Spring Boot App on AWS – Elastic Beanstalk](https://bezkoder.com/deploy-spring-boot-aws-eb/) 40 | 41 | Exception Handling: 42 | > [Spring Boot @ControllerAdvice & @ExceptionHandler example](https://bezkoder.com/spring-boot-controlleradvice-exceptionhandler/) 43 | 44 | > [@RestControllerAdvice example in Spring Boot](https://bezkoder.com/spring-boot-restcontrolleradvice/) 45 | 46 | Other databases: 47 | > [Spring Boot JPA + MySQL - Building Rest CRUD API example](https://bezkoder.com/spring-boot-jpa-crud-rest-api/) 48 | 49 | > [Spring Boot JPA + PostgreSQL - Building Rest CRUD API example](https://bezkoder.com/spring-boot-postgresql-example/) 50 | 51 | Security: 52 | > [Spring Boot + Spring Security JWT Authentication & Authorization](https://bezkoder.com/spring-boot-jwt-authentication/) 53 | 54 | Fullstack: 55 | > [Vue.js + Spring Boot example](https://bezkoder.com/spring-boot-vue-js-crud-example/) 56 | 57 | > [Angular 8 + Spring Boot example](https://bezkoder.com/angular-spring-boot-crud/) 58 | 59 | > [Angular 10 + Spring Boot example](https://bezkoder.com/angular-10-spring-boot-crud/) 60 | 61 | > [Angular 11 + Spring Boot example](https://bezkoder.com/angular-11-spring-boot-crud/) 62 | 63 | > [Angular 12 + Spring Boot example](https://bezkoder.com/angular-12-spring-boot-crud/) 64 | 65 | > [React + Spring Boot + MySQL example](https://bezkoder.com/react-spring-boot-crud/) 66 | 67 | > [React + Spring Boot + PostgreSQL example](https://bezkoder.com/spring-boot-react-postgresql/) 68 | 69 | Run both Back-end & Front-end in one place: 70 | > [Integrate Angular with Spring Boot Rest API](https://bezkoder.com/integrate-angular-spring-boot/) 71 | 72 | > [Integrate React.js with Spring Boot Rest API](https://bezkoder.com/integrate-reactjs-spring-boot/) 73 | 74 | > [Integrate Vue.js with Spring Boot Rest API](https://bezkoder.com/integrate-vue-spring-boot/) 75 | 76 | ## Run Spring Boot application 77 | ``` 78 | mvn spring-boot:run 79 | ``` 80 | 81 | -------------------------------------------------------------------------------- /spring-boot-server/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /spring-boot-server/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /spring-boot-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.1 9 | 10 | 11 | com.bezkoder 12 | spring-boot-jpa-h2 13 | 0.0.1-SNAPSHOT 14 | spring-boot-jpa-h2 15 | Spring Boot JPA + H2 database example - Rest CRUD Apis 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-data-jpa 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-web 30 | 31 | 32 | 33 | com.h2database 34 | h2 35 | runtime 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-test 41 | test 42 | 43 | 44 | 45 | 46 | 47 | 48 | org.springframework.boot 49 | spring-boot-maven-plugin 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /spring-boot-server/src/main/java/com/bezkoder/spring/jpa/h2/SpringBootJpaH2Application.java: -------------------------------------------------------------------------------- 1 | package com.bezkoder.spring.jpa.h2; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootJpaH2Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootJpaH2Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-server/src/main/java/com/bezkoder/spring/jpa/h2/controller/TutorialController.java: -------------------------------------------------------------------------------- 1 | package com.bezkoder.spring.jpa.h2.controller; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Optional; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.http.HttpStatus; 9 | import org.springframework.http.ResponseEntity; 10 | import org.springframework.web.bind.annotation.CrossOrigin; 11 | import org.springframework.web.bind.annotation.DeleteMapping; 12 | import org.springframework.web.bind.annotation.GetMapping; 13 | import org.springframework.web.bind.annotation.PathVariable; 14 | import org.springframework.web.bind.annotation.PostMapping; 15 | import org.springframework.web.bind.annotation.PutMapping; 16 | import org.springframework.web.bind.annotation.RequestBody; 17 | import org.springframework.web.bind.annotation.RequestMapping; 18 | import org.springframework.web.bind.annotation.RequestParam; 19 | import org.springframework.web.bind.annotation.RestController; 20 | 21 | import com.bezkoder.spring.jpa.h2.model.Tutorial; 22 | import com.bezkoder.spring.jpa.h2.repository.TutorialRepository; 23 | 24 | @CrossOrigin(origins = "http://localhost:8081") 25 | @RestController 26 | @RequestMapping("/api") 27 | public class TutorialController { 28 | 29 | @Autowired 30 | TutorialRepository tutorialRepository; 31 | 32 | @GetMapping("/tutorials") 33 | public ResponseEntity> getAllTutorials(@RequestParam(required = false) String title) { 34 | try { 35 | List tutorials = new ArrayList(); 36 | 37 | if (title == null) 38 | tutorialRepository.findAll().forEach(tutorials::add); 39 | else 40 | tutorialRepository.findByTitleContaining(title).forEach(tutorials::add); 41 | 42 | if (tutorials.isEmpty()) { 43 | return new ResponseEntity<>(HttpStatus.NO_CONTENT); 44 | } 45 | 46 | return new ResponseEntity<>(tutorials, HttpStatus.OK); 47 | } catch (Exception e) { 48 | return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR); 49 | } 50 | } 51 | 52 | @GetMapping("/tutorials/{id}") 53 | public ResponseEntity getTutorialById(@PathVariable("id") long id) { 54 | Optional tutorialData = tutorialRepository.findById(id); 55 | 56 | if (tutorialData.isPresent()) { 57 | return new ResponseEntity<>(tutorialData.get(), HttpStatus.OK); 58 | } else { 59 | return new ResponseEntity<>(HttpStatus.NOT_FOUND); 60 | } 61 | } 62 | 63 | @PostMapping("/tutorials") 64 | public ResponseEntity createTutorial(@RequestBody Tutorial tutorial) { 65 | try { 66 | Tutorial _tutorial = tutorialRepository 67 | .save(new Tutorial(tutorial.getTitle(), tutorial.getDescription(), false)); 68 | return new ResponseEntity<>(_tutorial, HttpStatus.CREATED); 69 | } catch (Exception e) { 70 | return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR); 71 | } 72 | } 73 | 74 | @PutMapping("/tutorials/{id}") 75 | public ResponseEntity updateTutorial(@PathVariable("id") long id, @RequestBody Tutorial tutorial) { 76 | Optional tutorialData = tutorialRepository.findById(id); 77 | 78 | if (tutorialData.isPresent()) { 79 | Tutorial _tutorial = tutorialData.get(); 80 | _tutorial.setTitle(tutorial.getTitle()); 81 | _tutorial.setDescription(tutorial.getDescription()); 82 | _tutorial.setPublished(tutorial.isPublished()); 83 | return new ResponseEntity<>(tutorialRepository.save(_tutorial), HttpStatus.OK); 84 | } else { 85 | return new ResponseEntity<>(HttpStatus.NOT_FOUND); 86 | } 87 | } 88 | 89 | @DeleteMapping("/tutorials/{id}") 90 | public ResponseEntity deleteTutorial(@PathVariable("id") long id) { 91 | try { 92 | tutorialRepository.deleteById(id); 93 | return new ResponseEntity<>(HttpStatus.NO_CONTENT); 94 | } catch (Exception e) { 95 | return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); 96 | } 97 | } 98 | 99 | @DeleteMapping("/tutorials") 100 | public ResponseEntity deleteAllTutorials() { 101 | try { 102 | tutorialRepository.deleteAll(); 103 | return new ResponseEntity<>(HttpStatus.NO_CONTENT); 104 | } catch (Exception e) { 105 | return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); 106 | } 107 | 108 | } 109 | 110 | @GetMapping("/tutorials/published") 111 | public ResponseEntity> findByPublished() { 112 | try { 113 | List tutorials = tutorialRepository.findByPublished(true); 114 | 115 | if (tutorials.isEmpty()) { 116 | return new ResponseEntity<>(HttpStatus.NO_CONTENT); 117 | } 118 | return new ResponseEntity<>(tutorials, HttpStatus.OK); 119 | } catch (Exception e) { 120 | return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); 121 | } 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /spring-boot-server/src/main/java/com/bezkoder/spring/jpa/h2/model/Tutorial.java: -------------------------------------------------------------------------------- 1 | package com.bezkoder.spring.jpa.h2.model; 2 | 3 | import javax.persistence.*; 4 | 5 | @Entity 6 | @Table(name = "tutorials") 7 | public class Tutorial { 8 | 9 | @Id 10 | @GeneratedValue(strategy = GenerationType.AUTO) 11 | private long id; 12 | 13 | @Column(name = "title") 14 | private String title; 15 | 16 | @Column(name = "description") 17 | private String description; 18 | 19 | @Column(name = "published") 20 | private boolean published; 21 | 22 | public Tutorial() { 23 | 24 | } 25 | 26 | public Tutorial(String title, String description, boolean published) { 27 | this.title = title; 28 | this.description = description; 29 | this.published = published; 30 | } 31 | 32 | public long getId() { 33 | return id; 34 | } 35 | 36 | public String getTitle() { 37 | return title; 38 | } 39 | 40 | public void setTitle(String title) { 41 | this.title = title; 42 | } 43 | 44 | public String getDescription() { 45 | return description; 46 | } 47 | 48 | public void setDescription(String description) { 49 | this.description = description; 50 | } 51 | 52 | public boolean isPublished() { 53 | return published; 54 | } 55 | 56 | public void setPublished(boolean isPublished) { 57 | this.published = isPublished; 58 | } 59 | 60 | @Override 61 | public String toString() { 62 | return "Tutorial [id=" + id + ", title=" + title + ", desc=" + description + ", published=" + published + "]"; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /spring-boot-server/src/main/java/com/bezkoder/spring/jpa/h2/repository/TutorialRepository.java: -------------------------------------------------------------------------------- 1 | package com.bezkoder.spring.jpa.h2.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import com.bezkoder.spring.jpa.h2.model.Tutorial; 8 | 9 | public interface TutorialRepository extends JpaRepository { 10 | List findByPublished(boolean published); 11 | 12 | List findByTitleContaining(String title); 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | # default path: h2-console 3 | spring.h2.console.path=/h2-ui 4 | 5 | spring.datasource.url=jdbc:h2:mem:testdb 6 | spring.datasource.driverClassName=org.h2.Driver 7 | spring.datasource.username=sa 8 | spring.datasource.password= 9 | 10 | spring.jpa.show-sql=true 11 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect 12 | spring.jpa.hibernate.ddl-auto= update -------------------------------------------------------------------------------- /spring-boot-server/src/test/java/com/bezkoder/spring/jpa/h2/SpringBootJpaH2ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.bezkoder.spring.jpa.h2; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootJpaH2ApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | --------------------------------------------------------------------------------