├── .editorconfig ├── .gitignore ├── Dockerfile ├── README.md ├── angular.json ├── api ├── .gitignore ├── DB.js ├── models │ └── Business.js ├── package-lock.json ├── package.json ├── routes │ └── business.route.js └── server.js ├── dist └── angular7crud │ ├── favicon.ico │ ├── index.html │ ├── main.js │ ├── main.js.map │ ├── polyfills.js │ ├── polyfills.js.map │ ├── runtime.js │ ├── runtime.js.map │ ├── styles.js │ ├── styles.js.map │ ├── vendor.js │ └── vendor.js.map ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.e2e.json ├── package-lock.json ├── package.json ├── src ├── app │ ├── Business.ts │ ├── DevOps.jpg │ ├── app-routing.module.ts │ ├── app.component.css │ ├── app.component.html │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── business.service.ts │ ├── gst-add │ │ ├── gst-add.component.css │ │ ├── gst-add.component.html │ │ └── gst-add.component.ts │ ├── gst-edit │ │ ├── gst-edit.component.css │ │ ├── gst-edit.component.html │ │ └── gst-edit.component.ts │ └── gst-get │ │ ├── gst-get.component.css │ │ ├── gst-get.component.html │ │ └── gst-get.component.ts ├── assets │ └── .gitkeep ├── browserslist ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── karma.conf.js ├── main.ts ├── polyfills.ts ├── styles.css ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── tslint.json ├── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:latest 2 | 3 | RUN mkdir -p /app/api 4 | RUN mkdir -p /app/dist 5 | ADD ./api /app/api 6 | COPY ./dist /app/dist 7 | 8 | WORKDIR /app/api 9 | RUN npm install 10 | EXPOSE 4000 11 | 12 | CMD ["node", "server.js"] 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Angular7crud 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.0.2. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | 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`. 12 | 13 | ## Build 14 | 15 | 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. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | 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). 28 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "angular7crud": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": {}, 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist/angular7crud", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "src/tsconfig.app.json", 21 | "assets": [ 22 | "src/favicon.ico", 23 | "src/assets" 24 | ], 25 | "styles": [ 26 | "src/styles.css", 27 | "./node_modules/bootstrap/dist/css/bootstrap.min.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 | } 56 | } 57 | }, 58 | "serve": { 59 | "builder": "@angular-devkit/build-angular:dev-server", 60 | "options": { 61 | "browserTarget": "angular7crud:build" 62 | }, 63 | "configurations": { 64 | "production": { 65 | "browserTarget": "angular7crud:build:production" 66 | } 67 | } 68 | }, 69 | "extract-i18n": { 70 | "builder": "@angular-devkit/build-angular:extract-i18n", 71 | "options": { 72 | "browserTarget": "angular7crud:build" 73 | } 74 | }, 75 | "test": { 76 | "builder": "@angular-devkit/build-angular:karma", 77 | "options": { 78 | "main": "src/test.ts", 79 | "polyfills": "src/polyfills.ts", 80 | "tsConfig": "src/tsconfig.spec.json", 81 | "karmaConfig": "src/karma.conf.js", 82 | "styles": [ 83 | "src/styles.css" 84 | ], 85 | "scripts": [], 86 | "assets": [ 87 | "src/favicon.ico", 88 | "src/assets" 89 | ] 90 | } 91 | }, 92 | "lint": { 93 | "builder": "@angular-devkit/build-angular:tslint", 94 | "options": { 95 | "tsConfig": [ 96 | "src/tsconfig.app.json", 97 | "src/tsconfig.spec.json" 98 | ], 99 | "exclude": [ 100 | "**/node_modules/**" 101 | ] 102 | } 103 | } 104 | } 105 | }, 106 | "angular7crud-e2e": { 107 | "root": "e2e/", 108 | "projectType": "application", 109 | "prefix": "", 110 | "architect": { 111 | "e2e": { 112 | "builder": "@angular-devkit/build-angular:protractor", 113 | "options": { 114 | "protractorConfig": "e2e/protractor.conf.js", 115 | "devServerTarget": "angular7crud:serve" 116 | }, 117 | "configurations": { 118 | "production": { 119 | "devServerTarget": "angular7crud:serve:production" 120 | } 121 | } 122 | }, 123 | "lint": { 124 | "builder": "@angular-devkit/build-angular:tslint", 125 | "options": { 126 | "tsConfig": "e2e/tsconfig.e2e.json", 127 | "exclude": [ 128 | "**/node_modules/**" 129 | ] 130 | } 131 | } 132 | } 133 | } 134 | }, 135 | "defaultProject": "angular7crud" 136 | } -------------------------------------------------------------------------------- /api/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules -------------------------------------------------------------------------------- /api/DB.js: -------------------------------------------------------------------------------- 1 | var host=process.env.DB_HOST||'localhost' 2 | console.log(host); 3 | module.exports = { 4 | DB: 'mongodb://'+host+':27017/ng7crud' 5 | }; -------------------------------------------------------------------------------- /api/models/Business.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | 4 | // Define collection and schema for Business 5 | let Business = new Schema({ 6 | person_name: { 7 | type: String 8 | }, 9 | business_name: { 10 | type: String 11 | }, 12 | business_gst_number: { 13 | type: Number 14 | } 15 | },{ 16 | collection: 'business' 17 | }); 18 | 19 | module.exports = mongoose.model('Business', Business); -------------------------------------------------------------------------------- /api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "api", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "body-parser": "^1.18.3", 14 | "cors": "^2.8.4", 15 | "express": "^4.16.4", 16 | "mongoose": "^5.3.9" 17 | }, 18 | "devDependencies": { 19 | "nodemon": "^1.18.5" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/routes/business.route.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const app = express(); 3 | const businessRoutes = express.Router(); 4 | 5 | // Require Business model in our routes module 6 | let Business = require('../models/Business'); 7 | 8 | // Defined store route 9 | businessRoutes.route('/add').post(function (req, res) { 10 | let business = new Business(req.body); 11 | business.save() 12 | .then(business => { 13 | res.status(200).json({'business': 'business in added successfully'}); 14 | }) 15 | .catch(err => { 16 | res.status(400).send("unable to save to database"); 17 | }); 18 | }); 19 | 20 | // Defined get data(index or listing) route 21 | businessRoutes.route('/').get(function (req, res) { 22 | Business.find(function (err, businesses){ 23 | if(err){ 24 | console.log(err); 25 | } 26 | else { 27 | res.json(businesses); 28 | } 29 | }); 30 | }); 31 | 32 | // Defined edit route 33 | businessRoutes.route('/edit/:id').get(function (req, res) { 34 | let id = req.params.id; 35 | Business.findById(id, function (err, business){ 36 | res.json(business); 37 | }); 38 | }); 39 | 40 | // Defined update route 41 | businessRoutes.route('/update/:id').post(function (req, res) { 42 | Business.findById(req.params.id, function(err, business) { 43 | if (!business) 44 | return next(new Error('Could not load Document')); 45 | else { 46 | business.person_name = req.body.person_name; 47 | business.business_name = req.body.business_name; 48 | business.business_gst_number = req.body.business_gst_number; 49 | 50 | business.save().then(business => { 51 | res.json('Update complete'); 52 | }) 53 | .catch(err => { 54 | res.status(400).send("unable to update the database"); 55 | }); 56 | } 57 | }); 58 | }); 59 | 60 | // Defined delete | remove | destroy route 61 | businessRoutes.route('/delete/:id').get(function (req, res) { 62 | Business.findByIdAndRemove({_id: req.params.id}, function(err, business){ 63 | if(err) res.json(err); 64 | else res.json('Successfully removed'); 65 | }); 66 | }); 67 | 68 | module.exports = businessRoutes; -------------------------------------------------------------------------------- /api/server.js: -------------------------------------------------------------------------------- 1 | const express = require('express'), 2 | path = require('path'), 3 | bodyParser = require('body-parser'), 4 | cors = require('cors'), 5 | mongoose = require('mongoose'), 6 | config = require('./DB'); 7 | 8 | const businessRoute = require('./routes/business.route'); 9 | mongoose.Promise = global.Promise; 10 | mongoose.connect(config.DB, { useNewUrlParser: true }).then( 11 | () => {console.log('Database is connected') }, 12 | err => { console.log('Cannot connect to the database'+ err)} 13 | ); 14 | var version=process.env.version || "1.0" 15 | 16 | const app = express(); 17 | app.use(bodyParser.json()); 18 | app.use(cors()); 19 | app.use(express.static(path.join(__dirname,'../dist/angular7crud'))); 20 | 21 | app.get('/getversion',function(req,res){ 22 | console.log('Version '+version); 23 | res.status(200).json({version:version}) 24 | }); 25 | app.use('/business', businessRoute); 26 | 27 | app.use('/',function(req,res){ 28 | res.sendFile(path.join(__dirname,'../dist/angular7crud','index.html')) 29 | }); 30 | const port = process.env.PORT || 4000; 31 | 32 | const server = app.listen(port, function(){ 33 | console.log('Listening on port ' + port); 34 | console.log('Version '+version); 35 | }); -------------------------------------------------------------------------------- /dist/angular7crud/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrunalLathiya/Angular7CRUDExample/5664061f1fd4058fb1dbf612d72e23f9dc39d9fe/dist/angular7crud/favicon.ico -------------------------------------------------------------------------------- /dist/angular7crud/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular7crud 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /dist/angular7crud/main.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["main"],{ 2 | 3 | /***/ "./src/$$_lazy_route_resource lazy recursive": 4 | /*!**********************************************************!*\ 5 | !*** ./src/$$_lazy_route_resource lazy namespace object ***! 6 | \**********************************************************/ 7 | /*! no static exports found */ 8 | /***/ (function(module, exports) { 9 | 10 | function webpackEmptyAsyncContext(req) { 11 | // Here Promise.resolve().then() is used instead of new Promise() to prevent 12 | // uncaught exception popping up in devtools 13 | return Promise.resolve().then(function() { 14 | var e = new Error("Cannot find module '" + req + "'"); 15 | e.code = 'MODULE_NOT_FOUND'; 16 | throw e; 17 | }); 18 | } 19 | webpackEmptyAsyncContext.keys = function() { return []; }; 20 | webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext; 21 | module.exports = webpackEmptyAsyncContext; 22 | webpackEmptyAsyncContext.id = "./src/$$_lazy_route_resource lazy recursive"; 23 | 24 | /***/ }), 25 | 26 | /***/ "./src/app/app-routing.module.ts": 27 | /*!***************************************!*\ 28 | !*** ./src/app/app-routing.module.ts ***! 29 | \***************************************/ 30 | /*! exports provided: AppRoutingModule */ 31 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 32 | 33 | "use strict"; 34 | __webpack_require__.r(__webpack_exports__); 35 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AppRoutingModule", function() { return AppRoutingModule; }); 36 | /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js"); 37 | /* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js"); 38 | /* harmony import */ var _gst_add_gst_add_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gst-add/gst-add.component */ "./src/app/gst-add/gst-add.component.ts"); 39 | /* harmony import */ var _gst_edit_gst_edit_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./gst-edit/gst-edit.component */ "./src/app/gst-edit/gst-edit.component.ts"); 40 | /* harmony import */ var _gst_get_gst_get_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./gst-get/gst-get.component */ "./src/app/gst-get/gst-get.component.ts"); 41 | var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { 42 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 43 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 44 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 45 | return c > 3 && r && Object.defineProperty(target, key, r), r; 46 | }; 47 | 48 | 49 | 50 | 51 | 52 | var routes = [ 53 | { 54 | path: 'business/create', 55 | component: _gst_add_gst_add_component__WEBPACK_IMPORTED_MODULE_2__["GstAddComponent"] 56 | }, 57 | { 58 | path: 'business/edit/:id', 59 | component: _gst_edit_gst_edit_component__WEBPACK_IMPORTED_MODULE_3__["GstEditComponent"] 60 | }, 61 | { 62 | path: 'business', 63 | component: _gst_get_gst_get_component__WEBPACK_IMPORTED_MODULE_4__["GstGetComponent"] 64 | } 65 | ]; 66 | var AppRoutingModule = /** @class */ (function () { 67 | function AppRoutingModule() { 68 | } 69 | AppRoutingModule = __decorate([ 70 | Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({ 71 | imports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"].forRoot(routes)], 72 | exports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"]] 73 | }) 74 | ], AppRoutingModule); 75 | return AppRoutingModule; 76 | }()); 77 | 78 | 79 | 80 | /***/ }), 81 | 82 | /***/ "./src/app/app.component.css": 83 | /*!***********************************!*\ 84 | !*** ./src/app/app.component.css ***! 85 | \***********************************/ 86 | /*! no static exports found */ 87 | /***/ (function(module, exports) { 88 | 89 | module.exports = "h1{\n text-align:center;\n}\nh2{\n text-align: center;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvYXBwLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7SUFDSSxrQkFBa0I7Q0FDckI7QUFDRDtJQUNJLG1CQUFtQjtDQUN0QiIsImZpbGUiOiJzcmMvYXBwL2FwcC5jb21wb25lbnQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiaDF7XG4gICAgdGV4dC1hbGlnbjpjZW50ZXI7XG59XG5oMntcbiAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XG59Il19 */" 90 | 91 | /***/ }), 92 | 93 | /***/ "./src/app/app.component.html": 94 | /*!************************************!*\ 95 | !*** ./src/app/app.component.html ***! 96 | \************************************/ 97 | /*! no static exports found */ 98 | /***/ (function(module, exports) { 99 | 100 | module.exports = "\n\n

Welcome to Azure Devops Demo!

\n

Build version number {{version.version}}

\n\n\n
\n
\n \n
" 101 | 102 | /***/ }), 103 | 104 | /***/ "./src/app/app.component.ts": 105 | /*!**********************************!*\ 106 | !*** ./src/app/app.component.ts ***! 107 | \**********************************/ 108 | /*! exports provided: AppComponent */ 109 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 110 | 111 | "use strict"; 112 | __webpack_require__.r(__webpack_exports__); 113 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AppComponent", function() { return AppComponent; }); 114 | /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js"); 115 | /* harmony import */ var ng2_slim_loading_bar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ng2-slim-loading-bar */ "./node_modules/ng2-slim-loading-bar/index.js"); 116 | /* harmony import */ var _app_business_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../app/business.service */ "./src/app/business.service.ts"); 117 | /* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js"); 118 | var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { 119 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 120 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 121 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 122 | return c > 3 && r && Object.defineProperty(target, key, r), r; 123 | }; 124 | var __metadata = (undefined && undefined.__metadata) || function (k, v) { 125 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 126 | }; 127 | 128 | 129 | 130 | 131 | var AppComponent = /** @class */ (function () { 132 | function AppComponent(_loadingBar, _router, bs) { 133 | var _this = this; 134 | this._loadingBar = _loadingBar; 135 | this._router = _router; 136 | this.bs = bs; 137 | this.title = 'angular7crud'; 138 | this._router.events.subscribe(function (event) { 139 | _this.navigationInterceptor(event); 140 | }); 141 | } 142 | AppComponent.prototype.ngOnInit = function () { 143 | var _this = this; 144 | this.bs 145 | .getVersion() 146 | .subscribe(function (data) { 147 | _this.version = data; 148 | console.log(_this.version); 149 | }); 150 | }; 151 | AppComponent.prototype.navigationInterceptor = function (event) { 152 | if (event instanceof _angular_router__WEBPACK_IMPORTED_MODULE_3__["NavigationStart"]) { 153 | this._loadingBar.start(); 154 | } 155 | if (event instanceof _angular_router__WEBPACK_IMPORTED_MODULE_3__["NavigationEnd"]) { 156 | this._loadingBar.complete(); 157 | } 158 | if (event instanceof _angular_router__WEBPACK_IMPORTED_MODULE_3__["NavigationCancel"]) { 159 | this._loadingBar.stop(); 160 | } 161 | if (event instanceof _angular_router__WEBPACK_IMPORTED_MODULE_3__["NavigationError"]) { 162 | this._loadingBar.stop(); 163 | } 164 | }; 165 | AppComponent = __decorate([ 166 | Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({ 167 | selector: 'app-root', 168 | template: __webpack_require__(/*! ./app.component.html */ "./src/app/app.component.html"), 169 | styles: [__webpack_require__(/*! ./app.component.css */ "./src/app/app.component.css")] 170 | }), 171 | __metadata("design:paramtypes", [ng2_slim_loading_bar__WEBPACK_IMPORTED_MODULE_1__["SlimLoadingBarService"], _angular_router__WEBPACK_IMPORTED_MODULE_3__["Router"], _app_business_service__WEBPACK_IMPORTED_MODULE_2__["BusinessService"]]) 172 | ], AppComponent); 173 | return AppComponent; 174 | }()); 175 | 176 | 177 | 178 | /***/ }), 179 | 180 | /***/ "./src/app/app.module.ts": 181 | /*!*******************************!*\ 182 | !*** ./src/app/app.module.ts ***! 183 | \*******************************/ 184 | /*! exports provided: AppModule */ 185 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 186 | 187 | "use strict"; 188 | __webpack_require__.r(__webpack_exports__); 189 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AppModule", function() { return AppModule; }); 190 | /* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/fesm5/platform-browser.js"); 191 | /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js"); 192 | /* harmony import */ var _app_routing_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./app-routing.module */ "./src/app/app-routing.module.ts"); 193 | /* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js"); 194 | /* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js"); 195 | /* harmony import */ var ng2_slim_loading_bar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ng2-slim-loading-bar */ "./node_modules/ng2-slim-loading-bar/index.js"); 196 | /* harmony import */ var _app_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./app.component */ "./src/app/app.component.ts"); 197 | /* harmony import */ var _gst_add_gst_add_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./gst-add/gst-add.component */ "./src/app/gst-add/gst-add.component.ts"); 198 | /* harmony import */ var _gst_get_gst_get_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./gst-get/gst-get.component */ "./src/app/gst-get/gst-get.component.ts"); 199 | /* harmony import */ var _gst_edit_gst_edit_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./gst-edit/gst-edit.component */ "./src/app/gst-edit/gst-edit.component.ts"); 200 | /* harmony import */ var _business_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./business.service */ "./src/app/business.service.ts"); 201 | var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { 202 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 203 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 204 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 205 | return c > 3 && r && Object.defineProperty(target, key, r), r; 206 | }; 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | var AppModule = /** @class */ (function () { 219 | function AppModule() { 220 | } 221 | AppModule = __decorate([ 222 | Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({ 223 | declarations: [ 224 | _app_component__WEBPACK_IMPORTED_MODULE_6__["AppComponent"], 225 | _gst_add_gst_add_component__WEBPACK_IMPORTED_MODULE_7__["GstAddComponent"], 226 | _gst_get_gst_get_component__WEBPACK_IMPORTED_MODULE_8__["GstGetComponent"], 227 | _gst_edit_gst_edit_component__WEBPACK_IMPORTED_MODULE_9__["GstEditComponent"] 228 | ], 229 | imports: [ 230 | _angular_platform_browser__WEBPACK_IMPORTED_MODULE_0__["BrowserModule"], 231 | _app_routing_module__WEBPACK_IMPORTED_MODULE_2__["AppRoutingModule"], 232 | ng2_slim_loading_bar__WEBPACK_IMPORTED_MODULE_5__["SlimLoadingBarModule"], 233 | _angular_forms__WEBPACK_IMPORTED_MODULE_3__["ReactiveFormsModule"], 234 | _angular_common_http__WEBPACK_IMPORTED_MODULE_4__["HttpClientModule"] 235 | ], 236 | providers: [_business_service__WEBPACK_IMPORTED_MODULE_10__["BusinessService"]], 237 | bootstrap: [_app_component__WEBPACK_IMPORTED_MODULE_6__["AppComponent"]] 238 | }) 239 | ], AppModule); 240 | return AppModule; 241 | }()); 242 | 243 | 244 | 245 | /***/ }), 246 | 247 | /***/ "./src/app/business.service.ts": 248 | /*!*************************************!*\ 249 | !*** ./src/app/business.service.ts ***! 250 | \*************************************/ 251 | /*! exports provided: BusinessService */ 252 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 253 | 254 | "use strict"; 255 | __webpack_require__.r(__webpack_exports__); 256 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BusinessService", function() { return BusinessService; }); 257 | /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js"); 258 | /* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js"); 259 | var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { 260 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 261 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 262 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 263 | return c > 3 && r && Object.defineProperty(target, key, r), r; 264 | }; 265 | var __metadata = (undefined && undefined.__metadata) || function (k, v) { 266 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 267 | }; 268 | 269 | 270 | var BusinessService = /** @class */ (function () { 271 | function BusinessService(http) { 272 | this.http = http; 273 | this.uri = '/business'; 274 | this.versionuri = '/getversion'; 275 | } 276 | BusinessService.prototype.addBusiness = function (person_name, business_name, business_gst_number) { 277 | var obj = { 278 | person_name: person_name, 279 | business_name: business_name, 280 | business_gst_number: business_gst_number 281 | }; 282 | this.http.post(this.uri + "/add", obj) 283 | .subscribe(function (res) { return console.log('Done'); }); 284 | }; 285 | BusinessService.prototype.getBusinesses = function () { 286 | return this 287 | .http 288 | .get("" + this.uri); 289 | }; 290 | BusinessService.prototype.getVersion = function () { 291 | return this 292 | .http 293 | .get("" + this.versionuri); 294 | }; 295 | BusinessService.prototype.editBusiness = function (id) { 296 | return this 297 | .http 298 | .get(this.uri + "/edit/" + id); 299 | }; 300 | BusinessService.prototype.updateBusiness = function (person_name, business_name, business_gst_number, id) { 301 | var obj = { 302 | person_name: person_name, 303 | business_name: business_name, 304 | business_gst_number: business_gst_number 305 | }; 306 | this 307 | .http 308 | .post(this.uri + "/update/" + id, obj) 309 | .subscribe(function (res) { return console.log('Done'); }); 310 | }; 311 | BusinessService.prototype.deleteBusiness = function (id) { 312 | return this 313 | .http 314 | .get(this.uri + "/delete/" + id); 315 | }; 316 | BusinessService = __decorate([ 317 | Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"])({ 318 | providedIn: 'root' 319 | }), 320 | __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpClient"]]) 321 | ], BusinessService); 322 | return BusinessService; 323 | }()); 324 | 325 | 326 | 327 | /***/ }), 328 | 329 | /***/ "./src/app/gst-add/gst-add.component.css": 330 | /*!***********************************************!*\ 331 | !*** ./src/app/gst-add/gst-add.component.css ***! 332 | \***********************************************/ 333 | /*! no static exports found */ 334 | /***/ (function(module, exports) { 335 | 336 | module.exports = "\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2dzdC1hZGQvZ3N0LWFkZC5jb21wb25lbnQuY3NzIn0= */" 337 | 338 | /***/ }), 339 | 340 | /***/ "./src/app/gst-add/gst-add.component.html": 341 | /*!************************************************!*\ 342 | !*** ./src/app/gst-add/gst-add.component.html ***! 343 | \************************************************/ 344 | /*! no static exports found */ 345 | /***/ (function(module, exports) { 346 | 347 | module.exports = "
\n
\n
\n
\n \n \n
\n
\n
\n Person Name is required.\n
\n
\n
\n \n \n
\n
\n
\n Person Business is required.\n
\n
\n
\n \n \n
\n
\n
\n Business GST Number is required.\n
\n
\n
\n \n
\n
\n
\n
" 348 | 349 | /***/ }), 350 | 351 | /***/ "./src/app/gst-add/gst-add.component.ts": 352 | /*!**********************************************!*\ 353 | !*** ./src/app/gst-add/gst-add.component.ts ***! 354 | \**********************************************/ 355 | /*! exports provided: GstAddComponent */ 356 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 357 | 358 | "use strict"; 359 | __webpack_require__.r(__webpack_exports__); 360 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GstAddComponent", function() { return GstAddComponent; }); 361 | /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js"); 362 | /* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js"); 363 | /* harmony import */ var _business_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../business.service */ "./src/app/business.service.ts"); 364 | var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { 365 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 366 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 367 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 368 | return c > 3 && r && Object.defineProperty(target, key, r), r; 369 | }; 370 | var __metadata = (undefined && undefined.__metadata) || function (k, v) { 371 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 372 | }; 373 | 374 | 375 | 376 | var GstAddComponent = /** @class */ (function () { 377 | function GstAddComponent(fb, bs) { 378 | this.fb = fb; 379 | this.bs = bs; 380 | this.createForm(); 381 | } 382 | GstAddComponent.prototype.createForm = function () { 383 | this.angForm = this.fb.group({ 384 | person_name: ['', _angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].required], 385 | business_name: ['', _angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].required], 386 | business_gst_number: ['', _angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].required] 387 | }); 388 | }; 389 | GstAddComponent.prototype.addBusiness = function (person_name, busines_name, business_gst_number) { 390 | this.bs.addBusiness(person_name, busines_name, business_gst_number); 391 | }; 392 | GstAddComponent.prototype.ngOnInit = function () { 393 | }; 394 | GstAddComponent = __decorate([ 395 | Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({ 396 | selector: 'app-gst-add', 397 | template: __webpack_require__(/*! ./gst-add.component.html */ "./src/app/gst-add/gst-add.component.html"), 398 | styles: [__webpack_require__(/*! ./gst-add.component.css */ "./src/app/gst-add/gst-add.component.css")] 399 | }), 400 | __metadata("design:paramtypes", [_angular_forms__WEBPACK_IMPORTED_MODULE_1__["FormBuilder"], _business_service__WEBPACK_IMPORTED_MODULE_2__["BusinessService"]]) 401 | ], GstAddComponent); 402 | return GstAddComponent; 403 | }()); 404 | 405 | 406 | 407 | /***/ }), 408 | 409 | /***/ "./src/app/gst-edit/gst-edit.component.css": 410 | /*!*************************************************!*\ 411 | !*** ./src/app/gst-edit/gst-edit.component.css ***! 412 | \*************************************************/ 413 | /*! no static exports found */ 414 | /***/ (function(module, exports) { 415 | 416 | module.exports = "\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2dzdC1lZGl0L2dzdC1lZGl0LmNvbXBvbmVudC5jc3MifQ== */" 417 | 418 | /***/ }), 419 | 420 | /***/ "./src/app/gst-edit/gst-edit.component.html": 421 | /*!**************************************************!*\ 422 | !*** ./src/app/gst-edit/gst-edit.component.html ***! 423 | \**************************************************/ 424 | /*! no static exports found */ 425 | /***/ (function(module, exports) { 426 | 427 | module.exports = "
\n
\n
\n
\n \n \n
\n
\n
\n Person Name is required.\n
\n
\n
\n \n \n
\n
\n
\n Person Business is required.\n
\n
\n
\n \n \n
\n
\n
\n Business GST Number is required.\n
\n
\n
\n \n
\n
\n
\n
" 428 | 429 | /***/ }), 430 | 431 | /***/ "./src/app/gst-edit/gst-edit.component.ts": 432 | /*!************************************************!*\ 433 | !*** ./src/app/gst-edit/gst-edit.component.ts ***! 434 | \************************************************/ 435 | /*! exports provided: GstEditComponent */ 436 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 437 | 438 | "use strict"; 439 | __webpack_require__.r(__webpack_exports__); 440 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GstEditComponent", function() { return GstEditComponent; }); 441 | /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js"); 442 | /* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js"); 443 | /* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js"); 444 | /* harmony import */ var _business_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../business.service */ "./src/app/business.service.ts"); 445 | var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { 446 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 447 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 448 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 449 | return c > 3 && r && Object.defineProperty(target, key, r), r; 450 | }; 451 | var __metadata = (undefined && undefined.__metadata) || function (k, v) { 452 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 453 | }; 454 | 455 | 456 | 457 | 458 | var GstEditComponent = /** @class */ (function () { 459 | function GstEditComponent(route, router, bs, fb) { 460 | this.route = route; 461 | this.router = router; 462 | this.bs = bs; 463 | this.fb = fb; 464 | this.business = {}; 465 | this.createForm(); 466 | } 467 | GstEditComponent.prototype.createForm = function () { 468 | this.angForm = this.fb.group({ 469 | person_name: ['', _angular_forms__WEBPACK_IMPORTED_MODULE_2__["Validators"].required], 470 | business_name: ['', _angular_forms__WEBPACK_IMPORTED_MODULE_2__["Validators"].required], 471 | business_gst_number: ['', _angular_forms__WEBPACK_IMPORTED_MODULE_2__["Validators"].required] 472 | }); 473 | }; 474 | GstEditComponent.prototype.ngOnInit = function () { 475 | var _this = this; 476 | this.route.params.subscribe(function (params) { 477 | _this.bs.editBusiness(params['id']).subscribe(function (res) { 478 | _this.business = res; 479 | }); 480 | }); 481 | }; 482 | GstEditComponent.prototype.updateBusiness = function (person_name, business_name, business_gst_number) { 483 | var _this = this; 484 | this.route.params.subscribe(function (params) { 485 | _this.bs.updateBusiness(person_name, business_name, business_gst_number, params['id']); 486 | _this.router.navigate(['business']); 487 | }); 488 | }; 489 | GstEditComponent = __decorate([ 490 | Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({ 491 | selector: 'app-gst-edit', 492 | template: __webpack_require__(/*! ./gst-edit.component.html */ "./src/app/gst-edit/gst-edit.component.html"), 493 | styles: [__webpack_require__(/*! ./gst-edit.component.css */ "./src/app/gst-edit/gst-edit.component.css")] 494 | }), 495 | __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"], 496 | _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"], 497 | _business_service__WEBPACK_IMPORTED_MODULE_3__["BusinessService"], 498 | _angular_forms__WEBPACK_IMPORTED_MODULE_2__["FormBuilder"]]) 499 | ], GstEditComponent); 500 | return GstEditComponent; 501 | }()); 502 | 503 | 504 | 505 | /***/ }), 506 | 507 | /***/ "./src/app/gst-get/gst-get.component.css": 508 | /*!***********************************************!*\ 509 | !*** ./src/app/gst-get/gst-get.component.css ***! 510 | \***********************************************/ 511 | /*! no static exports found */ 512 | /***/ (function(module, exports) { 513 | 514 | module.exports = "\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2dzdC1nZXQvZ3N0LWdldC5jb21wb25lbnQuY3NzIn0= */" 515 | 516 | /***/ }), 517 | 518 | /***/ "./src/app/gst-get/gst-get.component.html": 519 | /*!************************************************!*\ 520 | !*** ./src/app/gst-get/gst-get.component.html ***! 521 | \************************************************/ 522 | /*! no static exports found */ 523 | /***/ (function(module, exports) { 524 | 525 | module.exports = "\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n
Person NameBusiness NameGST NumberActions
{{ business.person_name }}{{ business.business_name }}{{ business.business_gst_number }}EditDelete
" 526 | 527 | /***/ }), 528 | 529 | /***/ "./src/app/gst-get/gst-get.component.ts": 530 | /*!**********************************************!*\ 531 | !*** ./src/app/gst-get/gst-get.component.ts ***! 532 | \**********************************************/ 533 | /*! exports provided: GstGetComponent */ 534 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 535 | 536 | "use strict"; 537 | __webpack_require__.r(__webpack_exports__); 538 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GstGetComponent", function() { return GstGetComponent; }); 539 | /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js"); 540 | /* harmony import */ var _business_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../business.service */ "./src/app/business.service.ts"); 541 | var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { 542 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 543 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 544 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 545 | return c > 3 && r && Object.defineProperty(target, key, r), r; 546 | }; 547 | var __metadata = (undefined && undefined.__metadata) || function (k, v) { 548 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 549 | }; 550 | 551 | 552 | var GstGetComponent = /** @class */ (function () { 553 | function GstGetComponent(bs) { 554 | this.bs = bs; 555 | } 556 | GstGetComponent.prototype.ngOnInit = function () { 557 | var _this = this; 558 | this.bs 559 | .getBusinesses() 560 | .subscribe(function (data) { 561 | _this.businesses = data; 562 | }); 563 | }; 564 | GstGetComponent.prototype.deleteBusiness = function (id) { 565 | this.bs.deleteBusiness(id).subscribe(function (res) { 566 | console.log('Deleted'); 567 | }); 568 | }; 569 | GstGetComponent = __decorate([ 570 | Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({ 571 | selector: 'app-gst-get', 572 | template: __webpack_require__(/*! ./gst-get.component.html */ "./src/app/gst-get/gst-get.component.html"), 573 | styles: [__webpack_require__(/*! ./gst-get.component.css */ "./src/app/gst-get/gst-get.component.css")] 574 | }), 575 | __metadata("design:paramtypes", [_business_service__WEBPACK_IMPORTED_MODULE_1__["BusinessService"]]) 576 | ], GstGetComponent); 577 | return GstGetComponent; 578 | }()); 579 | 580 | 581 | 582 | /***/ }), 583 | 584 | /***/ "./src/environments/environment.ts": 585 | /*!*****************************************!*\ 586 | !*** ./src/environments/environment.ts ***! 587 | \*****************************************/ 588 | /*! exports provided: environment */ 589 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 590 | 591 | "use strict"; 592 | __webpack_require__.r(__webpack_exports__); 593 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "environment", function() { return environment; }); 594 | // This file can be replaced during build by using the `fileReplacements` array. 595 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 596 | // The list of file replacements can be found in `angular.json`. 597 | var environment = { 598 | production: false 599 | }; 600 | /* 601 | * For easier debugging in development mode, you can import the following file 602 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 603 | * 604 | * This import should be commented out in production mode because it will have a negative impact 605 | * on performance if an error is thrown. 606 | */ 607 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 608 | 609 | 610 | /***/ }), 611 | 612 | /***/ "./src/main.ts": 613 | /*!*********************!*\ 614 | !*** ./src/main.ts ***! 615 | \*********************/ 616 | /*! no exports provided */ 617 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 618 | 619 | "use strict"; 620 | __webpack_require__.r(__webpack_exports__); 621 | /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js"); 622 | /* harmony import */ var _angular_platform_browser_dynamic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/platform-browser-dynamic */ "./node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js"); 623 | /* harmony import */ var _app_app_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./app/app.module */ "./src/app/app.module.ts"); 624 | /* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./environments/environment */ "./src/environments/environment.ts"); 625 | 626 | 627 | 628 | 629 | if (_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].production) { 630 | Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["enableProdMode"])(); 631 | } 632 | Object(_angular_platform_browser_dynamic__WEBPACK_IMPORTED_MODULE_1__["platformBrowserDynamic"])().bootstrapModule(_app_app_module__WEBPACK_IMPORTED_MODULE_2__["AppModule"]) 633 | .catch(function (err) { return console.error(err); }); 634 | 635 | 636 | /***/ }), 637 | 638 | /***/ 0: 639 | /*!***************************!*\ 640 | !*** multi ./src/main.ts ***! 641 | \***************************/ 642 | /*! no static exports found */ 643 | /***/ (function(module, exports, __webpack_require__) { 644 | 645 | module.exports = __webpack_require__(/*! /home/rle0612/Documents/Azure-Devops/Aws_project/Angular/src/main.ts */"./src/main.ts"); 646 | 647 | 648 | /***/ }) 649 | 650 | },[[0,"runtime","vendor"]]]); 651 | //# sourceMappingURL=main.js.map -------------------------------------------------------------------------------- /dist/angular7crud/main.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///./src/$_lazy_route_resource lazy namespace object","webpack:///./src/app/app-routing.module.ts","webpack:///./src/app/app.component.css","webpack:///./src/app/app.component.html","webpack:///./src/app/app.component.ts","webpack:///./src/app/app.module.ts","webpack:///./src/app/business.service.ts","webpack:///./src/app/gst-add/gst-add.component.css","webpack:///./src/app/gst-add/gst-add.component.html","webpack:///./src/app/gst-add/gst-add.component.ts","webpack:///./src/app/gst-edit/gst-edit.component.css","webpack:///./src/app/gst-edit/gst-edit.component.html","webpack:///./src/app/gst-edit/gst-edit.component.ts","webpack:///./src/app/gst-get/gst-get.component.css","webpack:///./src/app/gst-get/gst-get.component.html","webpack:///./src/app/gst-get/gst-get.component.ts","webpack:///./src/environments/environment.ts","webpack:///./src/main.ts"],"names":[],"mappings":"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","file":"main.js","sourcesContent":["function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = \"./src/$$_lazy_route_resource lazy recursive\";","import { NgModule } from '@angular/core';\nimport { Routes, RouterModule } from '@angular/router';\nimport { GstAddComponent } from './gst-add/gst-add.component';\nimport { GstEditComponent } from './gst-edit/gst-edit.component';\nimport { GstGetComponent } from './gst-get/gst-get.component';\n\nconst routes: Routes = [\n {\n path: 'business/create',\n component: GstAddComponent\n },\n {\n path: 'business/edit/:id',\n component: GstEditComponent\n },\n {\n path: 'business',\n component: GstGetComponent\n }\n];\n\n@NgModule({\n imports: [RouterModule.forRoot(routes)],\n exports: [RouterModule]\n})\n\nexport class AppRoutingModule { }\n","module.exports = \"h1{\\n text-align:center;\\n}\\nh2{\\n text-align: center;\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvYXBwLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7SUFDSSxrQkFBa0I7Q0FDckI7QUFDRDtJQUNJLG1CQUFtQjtDQUN0QiIsImZpbGUiOiJzcmMvYXBwL2FwcC5jb21wb25lbnQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiaDF7XG4gICAgdGV4dC1hbGlnbjpjZW50ZXI7XG59XG5oMntcbiAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XG59Il19 */\"","module.exports = \"\\n\\n

Welcome to Azure Devops Demo!

\\n

Build version number {{version.version}}

\\n\\n\\n
\\n
\\n \\n
\"","import { Component, OnInit } from '@angular/core';\nimport {SlimLoadingBarService} from 'ng2-slim-loading-bar';\nimport { BusinessService } from '../app/business.service';\n\nimport { NavigationCancel,\n Event,\n NavigationEnd,\n NavigationError,\n NavigationStart,\n Router } from '@angular/router';\n\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: ['./app.component.css']\n})\nexport class AppComponent implements OnInit{\n\n \n\n title = 'angular7crud';\n version;\n constructor(private _loadingBar: SlimLoadingBarService, private _router: Router,private bs: BusinessService) {\n this._router.events.subscribe((event: Event) => {\n this.navigationInterceptor(event);\n });\n }\n\n ngOnInit() {\n this.bs\n .getVersion()\n .subscribe((data) => {\n this.version = data;\n console.log(this.version)\n });\n }\n private navigationInterceptor(event: Event): void {\n if (event instanceof NavigationStart) {\n this._loadingBar.start();\n }\n if (event instanceof NavigationEnd) {\n this._loadingBar.complete();\n }\n if (event instanceof NavigationCancel) {\n this._loadingBar.stop();\n }\n if (event instanceof NavigationError) {\n this._loadingBar.stop();\n }\n }\n}\n","import { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\n\nimport { AppRoutingModule } from './app-routing.module';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { HttpClientModule } from '@angular/common/http';\nimport { SlimLoadingBarModule } from 'ng2-slim-loading-bar';\n\nimport { AppComponent } from './app.component';\nimport { GstAddComponent } from './gst-add/gst-add.component';\nimport { GstGetComponent } from './gst-get/gst-get.component';\nimport { GstEditComponent } from './gst-edit/gst-edit.component';\n\nimport { BusinessService } from './business.service';\n\n@NgModule({\n declarations: [\n AppComponent,\n GstAddComponent,\n GstGetComponent,\n GstEditComponent\n ],\n imports: [\n BrowserModule,\n AppRoutingModule,\n SlimLoadingBarModule,\n ReactiveFormsModule,\n HttpClientModule\n ],\n providers: [ BusinessService ],\n bootstrap: [AppComponent]\n})\nexport class AppModule { }\n","import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BusinessService {\n\n uri = '/business';\n versionuri = '/getversion';\n\n constructor(private http: HttpClient) { }\n\n addBusiness(person_name, business_name, business_gst_number) {\n const obj = {\n person_name: person_name,\n business_name: business_name,\n business_gst_number: business_gst_number\n };\n this.http.post(`${this.uri}/add`, obj)\n .subscribe(res => console.log('Done'));\n }\n\n getBusinesses() {\n return this\n .http\n .get(`${this.uri}`);\n }\n\n getVersion() {\n return this\n .http\n .get(`${this.versionuri}`);\n }\n\n editBusiness(id) {\n return this\n .http\n .get(`${this.uri}/edit/${id}`);\n }\n\n updateBusiness(person_name, business_name, business_gst_number, id) {\n\n const obj = {\n person_name: person_name,\n business_name: business_name,\n business_gst_number: business_gst_number\n };\n this\n .http\n .post(`${this.uri}/update/${id}`, obj)\n .subscribe(res => console.log('Done'));\n }\n\n deleteBusiness(id) {\n return this\n .http\n .get(`${this.uri}/delete/${id}`);\n }\n}\n","module.exports = \"\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2dzdC1hZGQvZ3N0LWFkZC5jb21wb25lbnQuY3NzIn0= */\"","module.exports = \"
\\n
\\n
\\n
\\n \\n \\n
\\n
\\n
\\n Person Name is required.\\n
\\n
\\n
\\n \\n \\n
\\n
\\n
\\n Person Business is required.\\n
\\n
\\n
\\n \\n \\n
\\n
\\n
\\n Business GST Number is required.\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n
\"","import { Component, OnInit } from '@angular/core';\nimport { FormGroup, FormBuilder, Validators } from '@angular/forms';\nimport { BusinessService } from '../business.service';\n\n@Component({\n selector: 'app-gst-add',\n templateUrl: './gst-add.component.html',\n styleUrls: ['./gst-add.component.css']\n})\nexport class GstAddComponent implements OnInit {\n\n angForm: FormGroup;\n constructor(private fb: FormBuilder, private bs: BusinessService) {\n this.createForm();\n }\n\n createForm() {\n this.angForm = this.fb.group({\n person_name: ['', Validators.required ],\n business_name: ['', Validators.required ],\n business_gst_number: ['', Validators.required ]\n });\n }\n\n addBusiness(person_name, busines_name, business_gst_number) {\n this.bs.addBusiness(person_name, busines_name, business_gst_number);\n }\n\n ngOnInit() {\n }\n\n}\n","module.exports = \"\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2dzdC1lZGl0L2dzdC1lZGl0LmNvbXBvbmVudC5jc3MifQ== */\"","module.exports = \"
\\n
\\n
\\n
\\n \\n \\n
\\n
\\n
\\n Person Name is required.\\n
\\n
\\n
\\n \\n \\n
\\n
\\n
\\n Person Business is required.\\n
\\n
\\n
\\n \\n \\n
\\n
\\n
\\n Business GST Number is required.\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n
\"","import { Component, OnInit } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { FormGroup, FormBuilder, Validators } from '@angular/forms';\nimport { BusinessService } from '../business.service';\n\n@Component({\n selector: 'app-gst-edit',\n templateUrl: './gst-edit.component.html',\n styleUrls: ['./gst-edit.component.css']\n})\nexport class GstEditComponent implements OnInit {\n\n angForm: FormGroup;\n business: any = {};\n\n constructor(private route: ActivatedRoute,\n private router: Router,\n private bs: BusinessService,\n private fb: FormBuilder) {\n this.createForm();\n }\n\n createForm() {\n this.angForm = this.fb.group({\n person_name: ['', Validators.required ],\n business_name: ['', Validators.required ],\n business_gst_number: ['', Validators.required ]\n });\n }\n\n\n ngOnInit() {\n this.route.params.subscribe(params => {\n this.bs.editBusiness(params['id']).subscribe(res => {\n this.business = res;\n });\n });\n }\n\n updateBusiness(person_name, business_name, business_gst_number) {\n this.route.params.subscribe(params => {\n this.bs.updateBusiness(person_name, business_name, business_gst_number, params['id']);\n this.router.navigate(['business']);\n });\n}\n}\n","module.exports = \"\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2dzdC1nZXQvZ3N0LWdldC5jb21wb25lbnQuY3NzIn0= */\"","module.exports = \"\\n \\n \\n \\n \\n \\n \\n \\n \\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
Person NameBusiness NameGST NumberActions
{{ business.person_name }}{{ business.business_name }}{{ business.business_gst_number }}EditDelete
\"","import { Component, OnInit } from '@angular/core';\nimport Business from '../Business';\nimport { BusinessService } from '../business.service';\n\n@Component({\n selector: 'app-gst-get',\n templateUrl: './gst-get.component.html',\n styleUrls: ['./gst-get.component.css']\n})\nexport class GstGetComponent implements OnInit {\n\n businesses: Business[];\n\n constructor(private bs: BusinessService) { }\n\n ngOnInit() {\n this.bs\n .getBusinesses()\n .subscribe((data: Business[]) => {\n this.businesses = data;\n });\n }\n\n deleteBusiness(id) {\n this.bs.deleteBusiness(id).subscribe(res => {\n console.log('Deleted');\n });\n }\n\n}\n","// This file can be replaced during build by using the `fileReplacements` array.\n// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.\n// The list of file replacements can be found in `angular.json`.\n\nexport const environment = {\n production: false\n};\n\n/*\n * For easier debugging in development mode, you can import the following file\n * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.\n *\n * This import should be commented out in production mode because it will have a negative impact\n * on performance if an error is thrown.\n */\n// import 'zone.js/dist/zone-error'; // Included with Angular CLI.\n","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport { AppModule } from './app/app.module';\nimport { environment } from './environments/environment';\n\nif (environment.production) {\n enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule)\n .catch(err => console.error(err));\n"],"sourceRoot":""} -------------------------------------------------------------------------------- /dist/angular7crud/runtime.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // install a JSONP callback for chunk loading 3 | /******/ function webpackJsonpCallback(data) { 4 | /******/ var chunkIds = data[0]; 5 | /******/ var moreModules = data[1]; 6 | /******/ var executeModules = data[2]; 7 | /******/ 8 | /******/ // add "moreModules" to the modules object, 9 | /******/ // then flag all "chunkIds" as loaded and fire callback 10 | /******/ var moduleId, chunkId, i = 0, resolves = []; 11 | /******/ for(;i < chunkIds.length; i++) { 12 | /******/ chunkId = chunkIds[i]; 13 | /******/ if(installedChunks[chunkId]) { 14 | /******/ resolves.push(installedChunks[chunkId][0]); 15 | /******/ } 16 | /******/ installedChunks[chunkId] = 0; 17 | /******/ } 18 | /******/ for(moduleId in moreModules) { 19 | /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { 20 | /******/ modules[moduleId] = moreModules[moduleId]; 21 | /******/ } 22 | /******/ } 23 | /******/ if(parentJsonpFunction) parentJsonpFunction(data); 24 | /******/ 25 | /******/ while(resolves.length) { 26 | /******/ resolves.shift()(); 27 | /******/ } 28 | /******/ 29 | /******/ // add entry modules from loaded chunk to deferred list 30 | /******/ deferredModules.push.apply(deferredModules, executeModules || []); 31 | /******/ 32 | /******/ // run deferred modules when all chunks ready 33 | /******/ return checkDeferredModules(); 34 | /******/ }; 35 | /******/ function checkDeferredModules() { 36 | /******/ var result; 37 | /******/ for(var i = 0; i < deferredModules.length; i++) { 38 | /******/ var deferredModule = deferredModules[i]; 39 | /******/ var fulfilled = true; 40 | /******/ for(var j = 1; j < deferredModule.length; j++) { 41 | /******/ var depId = deferredModule[j]; 42 | /******/ if(installedChunks[depId] !== 0) fulfilled = false; 43 | /******/ } 44 | /******/ if(fulfilled) { 45 | /******/ deferredModules.splice(i--, 1); 46 | /******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]); 47 | /******/ } 48 | /******/ } 49 | /******/ return result; 50 | /******/ } 51 | /******/ 52 | /******/ // The module cache 53 | /******/ var installedModules = {}; 54 | /******/ 55 | /******/ // object to store loaded and loading chunks 56 | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 57 | /******/ // Promise = chunk loading, 0 = chunk loaded 58 | /******/ var installedChunks = { 59 | /******/ "runtime": 0 60 | /******/ }; 61 | /******/ 62 | /******/ var deferredModules = []; 63 | /******/ 64 | /******/ // The require function 65 | /******/ function __webpack_require__(moduleId) { 66 | /******/ 67 | /******/ // Check if module is in cache 68 | /******/ if(installedModules[moduleId]) { 69 | /******/ return installedModules[moduleId].exports; 70 | /******/ } 71 | /******/ // Create a new module (and put it into the cache) 72 | /******/ var module = installedModules[moduleId] = { 73 | /******/ i: moduleId, 74 | /******/ l: false, 75 | /******/ exports: {} 76 | /******/ }; 77 | /******/ 78 | /******/ // Execute the module function 79 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 80 | /******/ 81 | /******/ // Flag the module as loaded 82 | /******/ module.l = true; 83 | /******/ 84 | /******/ // Return the exports of the module 85 | /******/ return module.exports; 86 | /******/ } 87 | /******/ 88 | /******/ 89 | /******/ // expose the modules object (__webpack_modules__) 90 | /******/ __webpack_require__.m = modules; 91 | /******/ 92 | /******/ // expose the module cache 93 | /******/ __webpack_require__.c = installedModules; 94 | /******/ 95 | /******/ // define getter function for harmony exports 96 | /******/ __webpack_require__.d = function(exports, name, getter) { 97 | /******/ if(!__webpack_require__.o(exports, name)) { 98 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 99 | /******/ } 100 | /******/ }; 101 | /******/ 102 | /******/ // define __esModule on exports 103 | /******/ __webpack_require__.r = function(exports) { 104 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 105 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 106 | /******/ } 107 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 108 | /******/ }; 109 | /******/ 110 | /******/ // create a fake namespace object 111 | /******/ // mode & 1: value is a module id, require it 112 | /******/ // mode & 2: merge all properties of value into the ns 113 | /******/ // mode & 4: return value when already ns object 114 | /******/ // mode & 8|1: behave like require 115 | /******/ __webpack_require__.t = function(value, mode) { 116 | /******/ if(mode & 1) value = __webpack_require__(value); 117 | /******/ if(mode & 8) return value; 118 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 119 | /******/ var ns = Object.create(null); 120 | /******/ __webpack_require__.r(ns); 121 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 122 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 123 | /******/ return ns; 124 | /******/ }; 125 | /******/ 126 | /******/ // getDefaultExport function for compatibility with non-harmony modules 127 | /******/ __webpack_require__.n = function(module) { 128 | /******/ var getter = module && module.__esModule ? 129 | /******/ function getDefault() { return module['default']; } : 130 | /******/ function getModuleExports() { return module; }; 131 | /******/ __webpack_require__.d(getter, 'a', getter); 132 | /******/ return getter; 133 | /******/ }; 134 | /******/ 135 | /******/ // Object.prototype.hasOwnProperty.call 136 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 137 | /******/ 138 | /******/ // __webpack_public_path__ 139 | /******/ __webpack_require__.p = ""; 140 | /******/ 141 | /******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; 142 | /******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); 143 | /******/ jsonpArray.push = webpackJsonpCallback; 144 | /******/ jsonpArray = jsonpArray.slice(); 145 | /******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); 146 | /******/ var parentJsonpFunction = oldJsonpFunction; 147 | /******/ 148 | /******/ 149 | /******/ // run deferred modules from other chunks 150 | /******/ checkDeferredModules(); 151 | /******/ }) 152 | /************************************************************************/ 153 | /******/ ([]); 154 | //# sourceMappingURL=runtime.js.map -------------------------------------------------------------------------------- /dist/angular7crud/runtime.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///webpack/bootstrap"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAiB,4BAA4B;AAC7C;AACA;AACA,0BAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAgB,uBAAuB;AACvC;;;AAGA;AACA","file":"runtime.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"runtime\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// run deferred modules from other chunks\n \tcheckDeferredModules();\n"],"sourceRoot":""} -------------------------------------------------------------------------------- /e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to angular7crud!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular7crud", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~7.0.0", 15 | "@angular/common": "~7.0.0", 16 | "@angular/compiler": "~7.0.0", 17 | "@angular/core": "~7.0.0", 18 | "@angular/forms": "~7.0.0", 19 | "@angular/http": "~7.0.0", 20 | "@angular/platform-browser": "~7.0.0", 21 | "@angular/platform-browser-dynamic": "~7.0.0", 22 | "@angular/router": "~7.0.0", 23 | "bootstrap": "^4.1.3", 24 | "core-js": "^2.5.4", 25 | "ng2-slim-loading-bar": "^4.0.0", 26 | "rxjs": "~6.3.3", 27 | "rxjs-compat": "^6.3.3", 28 | "zone.js": "~0.8.26" 29 | }, 30 | "devDependencies": { 31 | "@angular-devkit/build-angular": "~0.10.0", 32 | "@angular/cli": "~7.0.2", 33 | "@angular/compiler-cli": "~7.0.0", 34 | "@angular/language-service": "~7.0.0", 35 | "@types/node": "~8.9.4", 36 | "@types/jasmine": "~2.8.8", 37 | "@types/jasminewd2": "~2.0.3", 38 | "codelyzer": "~4.5.0", 39 | "jasmine-core": "~2.99.1", 40 | "jasmine-spec-reporter": "~4.2.1", 41 | "karma": "~3.0.0", 42 | "karma-chrome-launcher": "~2.2.0", 43 | "karma-coverage-istanbul-reporter": "~2.0.1", 44 | "karma-jasmine": "~1.1.2", 45 | "karma-jasmine-html-reporter": "^0.2.2", 46 | "protractor": "~5.4.0", 47 | "ts-node": "~7.0.0", 48 | "tslint": "~5.11.0", 49 | "typescript": "~3.1.1" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/app/Business.ts: -------------------------------------------------------------------------------- 1 | export default class Business { 2 | person_name: String; 3 | business_name: String; 4 | business_gst_number: Number; 5 | } 6 | -------------------------------------------------------------------------------- /src/app/DevOps.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrunalLathiya/Angular7CRUDExample/5664061f1fd4058fb1dbf612d72e23f9dc39d9fe/src/app/DevOps.jpg -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { GstAddComponent } from './gst-add/gst-add.component'; 4 | import { GstEditComponent } from './gst-edit/gst-edit.component'; 5 | import { GstGetComponent } from './gst-get/gst-get.component'; 6 | 7 | const routes: Routes = [ 8 | { 9 | path: 'business/create', 10 | component: GstAddComponent 11 | }, 12 | { 13 | path: 'business/edit/:id', 14 | component: GstEditComponent 15 | }, 16 | { 17 | path: 'business', 18 | component: GstGetComponent 19 | } 20 | ]; 21 | 22 | @NgModule({ 23 | imports: [RouterModule.forRoot(routes)], 24 | exports: [RouterModule] 25 | }) 26 | 27 | export class AppRoutingModule { } 28 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- 1 | h1{ 2 | text-align:center; 3 | } 4 | h2{ 5 | text-align: center; 6 | } -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Welcome to Azure Devops Demo!

4 |

Build version number {{version.version}}

5 | 6 | 22 |
23 |
24 | 25 |
-------------------------------------------------------------------------------- /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 'angular7crud'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.debugElement.componentInstance; 26 | expect(app.title).toEqual('angular7crud'); 27 | }); 28 | 29 | it('should render title in a h1 tag', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.debugElement.nativeElement; 33 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to angular7crud!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import {SlimLoadingBarService} from 'ng2-slim-loading-bar'; 3 | import { BusinessService } from '../app/business.service'; 4 | 5 | import { NavigationCancel, 6 | Event, 7 | NavigationEnd, 8 | NavigationError, 9 | NavigationStart, 10 | Router } from '@angular/router'; 11 | 12 | @Component({ 13 | selector: 'app-root', 14 | templateUrl: './app.component.html', 15 | styleUrls: ['./app.component.css'] 16 | }) 17 | export class AppComponent implements OnInit{ 18 | 19 | 20 | 21 | title = 'angular7crud'; 22 | version; 23 | constructor(private _loadingBar: SlimLoadingBarService, private _router: Router,private bs: BusinessService) { 24 | this._router.events.subscribe((event: Event) => { 25 | this.navigationInterceptor(event); 26 | }); 27 | } 28 | 29 | ngOnInit() { 30 | this.bs 31 | .getVersion() 32 | .subscribe((data) => { 33 | this.version = data; 34 | console.log(this.version) 35 | }); 36 | } 37 | private navigationInterceptor(event: Event): void { 38 | if (event instanceof NavigationStart) { 39 | this._loadingBar.start(); 40 | } 41 | if (event instanceof NavigationEnd) { 42 | this._loadingBar.complete(); 43 | } 44 | if (event instanceof NavigationCancel) { 45 | this._loadingBar.stop(); 46 | } 47 | if (event instanceof NavigationError) { 48 | this._loadingBar.stop(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppRoutingModule } from './app-routing.module'; 5 | import { ReactiveFormsModule } from '@angular/forms'; 6 | import { HttpClientModule } from '@angular/common/http'; 7 | import { SlimLoadingBarModule } from 'ng2-slim-loading-bar'; 8 | 9 | import { AppComponent } from './app.component'; 10 | import { GstAddComponent } from './gst-add/gst-add.component'; 11 | import { GstGetComponent } from './gst-get/gst-get.component'; 12 | import { GstEditComponent } from './gst-edit/gst-edit.component'; 13 | 14 | import { BusinessService } from './business.service'; 15 | 16 | @NgModule({ 17 | declarations: [ 18 | AppComponent, 19 | GstAddComponent, 20 | GstGetComponent, 21 | GstEditComponent 22 | ], 23 | imports: [ 24 | BrowserModule, 25 | AppRoutingModule, 26 | SlimLoadingBarModule, 27 | ReactiveFormsModule, 28 | HttpClientModule 29 | ], 30 | providers: [ BusinessService ], 31 | bootstrap: [AppComponent] 32 | }) 33 | export class AppModule { } 34 | -------------------------------------------------------------------------------- /src/app/business.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | 4 | @Injectable({ 5 | providedIn: 'root' 6 | }) 7 | export class BusinessService { 8 | 9 | uri = '/business'; 10 | versionuri = '/getversion'; 11 | 12 | constructor(private http: HttpClient) { } 13 | 14 | addBusiness(person_name, business_name, business_gst_number) { 15 | const obj = { 16 | person_name: person_name, 17 | business_name: business_name, 18 | business_gst_number: business_gst_number 19 | }; 20 | this.http.post(`${this.uri}/add`, obj) 21 | .subscribe(res => console.log('Done')); 22 | } 23 | 24 | getBusinesses() { 25 | return this 26 | .http 27 | .get(`${this.uri}`); 28 | } 29 | 30 | getVersion() { 31 | return this 32 | .http 33 | .get(`${this.versionuri}`); 34 | } 35 | 36 | editBusiness(id) { 37 | return this 38 | .http 39 | .get(`${this.uri}/edit/${id}`); 40 | } 41 | 42 | updateBusiness(person_name, business_name, business_gst_number, id) { 43 | 44 | const obj = { 45 | person_name: person_name, 46 | business_name: business_name, 47 | business_gst_number: business_gst_number 48 | }; 49 | this 50 | .http 51 | .post(`${this.uri}/update/${id}`, obj) 52 | .subscribe(res => console.log('Done')); 53 | } 54 | 55 | deleteBusiness(id) { 56 | return this 57 | .http 58 | .get(`${this.uri}/delete/${id}`); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/app/gst-add/gst-add.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrunalLathiya/Angular7CRUDExample/5664061f1fd4058fb1dbf612d72e23f9dc39d9fe/src/app/gst-add/gst-add.component.css -------------------------------------------------------------------------------- /src/app/gst-add/gst-add.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 | 7 |
8 |
9 |
10 | Person Name is required. 11 |
12 |
13 |
14 | 15 | 16 |
17 |
18 |
19 | Person Business is required. 20 |
21 |
22 |
23 | 24 | 25 |
26 |
27 |
28 | Business GST Number is required. 29 |
30 |
31 |
32 | 35 |
36 |
37 |
38 |
-------------------------------------------------------------------------------- /src/app/gst-add/gst-add.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormGroup, FormBuilder, Validators } from '@angular/forms'; 3 | import { BusinessService } from '../business.service'; 4 | 5 | @Component({ 6 | selector: 'app-gst-add', 7 | templateUrl: './gst-add.component.html', 8 | styleUrls: ['./gst-add.component.css'] 9 | }) 10 | export class GstAddComponent implements OnInit { 11 | 12 | angForm: FormGroup; 13 | constructor(private fb: FormBuilder, private bs: BusinessService) { 14 | this.createForm(); 15 | } 16 | 17 | createForm() { 18 | this.angForm = this.fb.group({ 19 | person_name: ['', Validators.required ], 20 | business_name: ['', Validators.required ], 21 | business_gst_number: ['', Validators.required ] 22 | }); 23 | } 24 | 25 | addBusiness(person_name, busines_name, business_gst_number) { 26 | this.bs.addBusiness(person_name, busines_name, business_gst_number); 27 | } 28 | 29 | ngOnInit() { 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/app/gst-edit/gst-edit.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrunalLathiya/Angular7CRUDExample/5664061f1fd4058fb1dbf612d72e23f9dc39d9fe/src/app/gst-edit/gst-edit.component.css -------------------------------------------------------------------------------- /src/app/gst-edit/gst-edit.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 | 7 |
8 |
9 |
10 | Person Name is required. 11 |
12 |
13 |
14 | 15 | 16 |
17 |
18 |
19 | Person Business is required. 20 |
21 |
22 |
23 | 24 | 25 |
26 |
27 |
28 | Business GST Number is required. 29 |
30 |
31 |
32 | 35 |
36 |
37 |
38 |
-------------------------------------------------------------------------------- /src/app/gst-edit/gst-edit.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute, Router } from '@angular/router'; 3 | import { FormGroup, FormBuilder, Validators } from '@angular/forms'; 4 | import { BusinessService } from '../business.service'; 5 | 6 | @Component({ 7 | selector: 'app-gst-edit', 8 | templateUrl: './gst-edit.component.html', 9 | styleUrls: ['./gst-edit.component.css'] 10 | }) 11 | export class GstEditComponent implements OnInit { 12 | 13 | angForm: FormGroup; 14 | business: any = {}; 15 | 16 | constructor(private route: ActivatedRoute, 17 | private router: Router, 18 | private bs: BusinessService, 19 | private fb: FormBuilder) { 20 | this.createForm(); 21 | } 22 | 23 | createForm() { 24 | this.angForm = this.fb.group({ 25 | person_name: ['', Validators.required ], 26 | business_name: ['', Validators.required ], 27 | business_gst_number: ['', Validators.required ] 28 | }); 29 | } 30 | 31 | 32 | ngOnInit() { 33 | this.route.params.subscribe(params => { 34 | this.bs.editBusiness(params['id']).subscribe(res => { 35 | this.business = res; 36 | }); 37 | }); 38 | } 39 | 40 | updateBusiness(person_name, business_name, business_gst_number) { 41 | this.route.params.subscribe(params => { 42 | this.bs.updateBusiness(person_name, business_name, business_gst_number, params['id']); 43 | this.router.navigate(['business']); 44 | }); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/app/gst-get/gst-get.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrunalLathiya/Angular7CRUDExample/5664061f1fd4058fb1dbf612d72e23f9dc39d9fe/src/app/gst-get/gst-get.component.css -------------------------------------------------------------------------------- /src/app/gst-get/gst-get.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
Person NameBusiness NameGST NumberActions
{{ business.person_name }}{{ business.business_name }}{{ business.business_gst_number }}EditDelete
-------------------------------------------------------------------------------- /src/app/gst-get/gst-get.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import Business from '../Business'; 3 | import { BusinessService } from '../business.service'; 4 | 5 | @Component({ 6 | selector: 'app-gst-get', 7 | templateUrl: './gst-get.component.html', 8 | styleUrls: ['./gst-get.component.css'] 9 | }) 10 | export class GstGetComponent implements OnInit { 11 | 12 | businesses: Business[]; 13 | 14 | constructor(private bs: BusinessService) { } 15 | 16 | ngOnInit() { 17 | this.bs 18 | .getBusinesses() 19 | .subscribe((data: Business[]) => { 20 | this.businesses = data; 21 | }); 22 | } 23 | 24 | deleteBusiness(id) { 25 | this.bs.deleteBusiness(id).subscribe(res => { 26 | console.log('Deleted'); 27 | }); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrunalLathiya/Angular7CRUDExample/5664061f1fd4058fb1dbf612d72e23f9dc39d9fe/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrunalLathiya/Angular7CRUDExample/5664061f1fd4058fb1dbf612d72e23f9dc39d9fe/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular7crud 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/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'), 20 | reports: ['html', 'lcovonly'], 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 | }); 31 | }; -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** 38 | * If the application will be indexed by Google Search, the following is required. 39 | * Googlebot uses a renderer based on Chrome 41. 40 | * https://developers.google.com/search/docs/guides/rendering 41 | **/ 42 | // import 'core-js/es6/array'; 43 | 44 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 45 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 46 | 47 | /** IE10 and IE11 requires the following for the Reflect API. */ 48 | // import 'core-js/es6/reflect'; 49 | 50 | /** 51 | * Web Animations `@angular/platform-browser/animations` 52 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 53 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 54 | **/ 55 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 56 | 57 | /** 58 | * By default, zone.js will patch all possible macroTask and DomEvents 59 | * user can disable parts of macroTask/DomEvents patch by setting following flags 60 | */ 61 | 62 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 63 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 64 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 65 | 66 | /* 67 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 68 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 69 | */ 70 | // (window as any).__Zone_enable_cross_context_check = true; 71 | 72 | /*************************************************************************************************** 73 | * Zone JS is required by default for Angular itself. 74 | */ 75 | import 'zone.js/dist/zone'; // Included with Angular CLI. 76 | 77 | 78 | /*************************************************************************************************** 79 | * APPLICATION IMPORTS 80 | */ 81 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import "../node_modules/ng2-slim-loading-bar/style.css"; -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "target": "es5", 13 | "typeRoots": [ 14 | "node_modules/@types" 15 | ], 16 | "lib": [ 17 | "es2018", 18 | "dom" 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-redundant-jsdoc": true, 69 | "no-shadowed-variable": true, 70 | "no-string-literal": false, 71 | "no-string-throw": true, 72 | "no-switch-case-fall-through": true, 73 | "no-trailing-whitespace": true, 74 | "no-unnecessary-initializer": true, 75 | "no-unused-expression": true, 76 | "no-use-before-declare": true, 77 | "no-var-keyword": true, 78 | "object-literal-sort-keys": false, 79 | "one-line": [ 80 | true, 81 | "check-open-brace", 82 | "check-catch", 83 | "check-else", 84 | "check-whitespace" 85 | ], 86 | "prefer-const": true, 87 | "quotemark": [ 88 | true, 89 | "single" 90 | ], 91 | "radix": true, 92 | "semicolon": [ 93 | true, 94 | "always" 95 | ], 96 | "triple-equals": [ 97 | true, 98 | "allow-null-check" 99 | ], 100 | "typedef-whitespace": [ 101 | true, 102 | { 103 | "call-signature": "nospace", 104 | "index-signature": "nospace", 105 | "parameter": "nospace", 106 | "property-declaration": "nospace", 107 | "variable-declaration": "nospace" 108 | } 109 | ], 110 | "unified-signatures": true, 111 | "variable-name": false, 112 | "whitespace": [ 113 | true, 114 | "check-branch", 115 | "check-decl", 116 | "check-operator", 117 | "check-separator", 118 | "check-type" 119 | ], 120 | "no-output-on-prefix": true, 121 | "use-input-property-decorator": true, 122 | "use-output-property-decorator": true, 123 | "use-host-property-decorator": true, 124 | "no-input-rename": true, 125 | "no-output-rename": true, 126 | "use-life-cycle-interface": true, 127 | "use-pipe-transform-interface": true, 128 | "component-class-suffix": true, 129 | "directive-class-suffix": true 130 | } 131 | } 132 | --------------------------------------------------------------------------------