├── AngularApp ├── .angular-cli.json ├── .editorconfig ├── .gitignore ├── README.md ├── e2e │ ├── app.e2e-spec.ts │ ├── app.po.ts │ └── tsconfig.e2e.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── protractor.conf.js ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── employee │ │ │ ├── employee.component.css │ │ │ ├── employee.component.html │ │ │ ├── employee.component.spec.ts │ │ │ └── employee.component.ts │ │ └── shared │ │ │ ├── employee.model.ts │ │ │ ├── employee.service.spec.ts │ │ │ └── employee.service.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── typings.d.ts ├── tsconfig.json └── tslint.json ├── NodeJS ├── controllers │ └── employeeController.js ├── db.js ├── index.js ├── models │ └── employee.js ├── package-lock.json └── package.json └── README.md /AngularApp/.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "angular-app" 5 | }, 6 | "apps": [ 7 | { 8 | "root": "src", 9 | "outDir": "dist", 10 | "assets": [ 11 | "assets", 12 | "favicon.ico" 13 | ], 14 | "index": "index.html", 15 | "main": "main.ts", 16 | "polyfills": "polyfills.ts", 17 | "test": "test.ts", 18 | "tsconfig": "tsconfig.app.json", 19 | "testTsconfig": "tsconfig.spec.json", 20 | "prefix": "app", 21 | "styles": [ 22 | "styles.css" 23 | ], 24 | "scripts": [], 25 | "environmentSource": "environments/environment.ts", 26 | "environments": { 27 | "dev": "environments/environment.ts", 28 | "prod": "environments/environment.prod.ts" 29 | } 30 | } 31 | ], 32 | "e2e": { 33 | "protractor": { 34 | "config": "./protractor.conf.js" 35 | } 36 | }, 37 | "lint": [ 38 | { 39 | "project": "src/tsconfig.app.json", 40 | "exclude": "**/node_modules/**" 41 | }, 42 | { 43 | "project": "src/tsconfig.spec.json", 44 | "exclude": "**/node_modules/**" 45 | }, 46 | { 47 | "project": "e2e/tsconfig.e2e.json", 48 | "exclude": "**/node_modules/**" 49 | } 50 | ], 51 | "test": { 52 | "karma": { 53 | "config": "./karma.conf.js" 54 | } 55 | }, 56 | "defaults": { 57 | "styleExt": "css", 58 | "component": {} 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /AngularApp/.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 | -------------------------------------------------------------------------------- /AngularApp/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /dist-server 6 | /tmp 7 | /out-tsc 8 | 9 | # dependencies 10 | /node_modules 11 | 12 | # IDEs and editors 13 | /.idea 14 | .project 15 | .classpath 16 | .c9/ 17 | *.launch 18 | .settings/ 19 | *.sublime-workspace 20 | 21 | # IDE - VSCode 22 | .vscode/* 23 | !.vscode/settings.json 24 | !.vscode/tasks.json 25 | !.vscode/launch.json 26 | !.vscode/extensions.json 27 | 28 | # misc 29 | /.sass-cache 30 | /connect.lock 31 | /coverage 32 | /libpeerconnection.log 33 | npm-debug.log 34 | testem.log 35 | /typings 36 | 37 | # e2e 38 | /e2e/*.js 39 | /e2e/*.map 40 | 41 | # System Files 42 | .DS_Store 43 | Thumbs.db 44 | -------------------------------------------------------------------------------- /AngularApp/README.md: -------------------------------------------------------------------------------- 1 | # AngularApp 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.6. 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 | -------------------------------------------------------------------------------- /AngularApp/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('angular-app 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 app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /AngularApp/e2e/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 | -------------------------------------------------------------------------------- /AngularApp/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /AngularApp/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/cli'], 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/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | reports: [ 'html', 'lcovonly' ], 20 | fixWebpackSourcePaths: true 21 | }, 22 | angularCli: { 23 | environment: 'dev' 24 | }, 25 | reporters: ['progress', 'kjhtml'], 26 | port: 9876, 27 | colors: true, 28 | logLevel: config.LOG_INFO, 29 | autoWatch: true, 30 | browsers: ['Chrome'], 31 | singleRun: false 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /AngularApp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-app", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "start": "ng serve", 8 | "build": "ng build --prod", 9 | "test": "ng test", 10 | "lint": "ng lint", 11 | "e2e": "ng e2e" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular/animations": "^5.2.0", 16 | "@angular/common": "^5.2.0", 17 | "@angular/compiler": "^5.2.0", 18 | "@angular/core": "^5.2.0", 19 | "@angular/forms": "^5.2.0", 20 | "@angular/http": "^5.2.0", 21 | "@angular/platform-browser": "^5.2.0", 22 | "@angular/platform-browser-dynamic": "^5.2.0", 23 | "@angular/router": "^5.2.0", 24 | "core-js": "^2.4.1", 25 | "rxjs": "^5.5.6", 26 | "zone.js": "^0.8.19" 27 | }, 28 | "devDependencies": { 29 | "@angular/cli": "1.6.6", 30 | "@angular/compiler-cli": "^5.2.0", 31 | "@angular/language-service": "^5.2.0", 32 | "@types/jasmine": "~2.8.3", 33 | "@types/jasminewd2": "~2.0.2", 34 | "@types/node": "~6.0.60", 35 | "codelyzer": "^4.0.1", 36 | "jasmine-core": "~2.8.0", 37 | "jasmine-spec-reporter": "~4.2.1", 38 | "karma": "~2.0.0", 39 | "karma-chrome-launcher": "~2.2.0", 40 | "karma-coverage-istanbul-reporter": "^1.2.1", 41 | "karma-jasmine": "~1.1.0", 42 | "karma-jasmine-html-reporter": "^0.2.2", 43 | "protractor": "~5.1.2", 44 | "ts-node": "~4.1.0", 45 | "tslint": "~5.9.1", 46 | "typescript": "~2.5.3" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /AngularApp/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 | './e2e/**/*.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: 'e2e/tsconfig.e2e.json' 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /AngularApp/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodAffection/MEAN-Stack-CRUD-Operations/9331498b756de0e86b4338c0dfc78d3dc3954b99/AngularApp/src/app/app.component.css -------------------------------------------------------------------------------- /AngularApp/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /AngularApp/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'app'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('app'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /AngularApp/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app'; 10 | } 11 | -------------------------------------------------------------------------------- /AngularApp/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { HttpClientModule } from '@angular/common/http'; 5 | 6 | import { AppComponent } from './app.component'; 7 | import { EmployeeComponent } from './employee/employee.component'; 8 | 9 | 10 | @NgModule({ 11 | declarations: [ 12 | AppComponent, 13 | EmployeeComponent 14 | ], 15 | imports: [ 16 | BrowserModule, 17 | FormsModule, 18 | HttpClientModule 19 | ], 20 | providers: [], 21 | bootstrap: [AppComponent] 22 | }) 23 | export class AppModule { } 24 | -------------------------------------------------------------------------------- /AngularApp/src/app/employee/employee.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodAffection/MEAN-Stack-CRUD-Operations/9331498b756de0e86b4338c0dfc78d3dc3954b99/AngularApp/src/app/employee/employee.component.css -------------------------------------------------------------------------------- /AngularApp/src/app/employee/employee.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 9 |
10 |
11 | 12 | 15 |
16 |
17 |
18 |
19 | 20 | 21 |
22 |
23 |
24 |
25 | 26 | 27 |
28 |
29 |
30 |
31 | 32 | 33 |
34 |
35 |
36 |
37 | 38 | 39 |
40 |
41 |
42 |
43 |
44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 65 | 66 |
NamePositionOffice
{{emp.name}}{{emp.position}}{{emp.office}} 58 | 59 | edit 60 | 61 | 62 | delete 63 | 64 |
67 |
68 |
69 |
70 |
71 |
72 | 73 |
-------------------------------------------------------------------------------- /AngularApp/src/app/employee/employee.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { EmployeeComponent } from './employee.component'; 4 | 5 | describe('EmployeeComponent', () => { 6 | let component: EmployeeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ EmployeeComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(EmployeeComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /AngularApp/src/app/employee/employee.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { NgForm } from '@angular/forms'; 3 | 4 | import { EmployeeService } from '../shared/employee.service'; 5 | import { Employee } from '../shared/employee.model'; 6 | 7 | declare var M: any; 8 | 9 | @Component({ 10 | selector: 'app-employee', 11 | templateUrl: './employee.component.html', 12 | styleUrls: ['./employee.component.css'], 13 | providers: [EmployeeService] 14 | }) 15 | export class EmployeeComponent implements OnInit { 16 | 17 | constructor(private employeeService: EmployeeService) { } 18 | 19 | ngOnInit() { 20 | this.resetForm(); 21 | this.refreshEmployeeList(); 22 | } 23 | 24 | resetForm(form?: NgForm) { 25 | if (form) 26 | form.reset(); 27 | this.employeeService.selectedEmployee = { 28 | _id: "", 29 | name: "", 30 | position: "", 31 | office: "", 32 | salary: null 33 | } 34 | } 35 | 36 | onSubmit(form: NgForm) { 37 | if (form.value._id == "") { 38 | this.employeeService.postEmployee(form.value).subscribe((res) => { 39 | this.resetForm(form); 40 | this.refreshEmployeeList(); 41 | M.toast({ html: 'Saved successfully', classes: 'rounded' }); 42 | }); 43 | } 44 | else { 45 | this.employeeService.putEmployee(form.value).subscribe((res) => { 46 | this.resetForm(form); 47 | this.refreshEmployeeList(); 48 | M.toast({ html: 'Updated successfully', classes: 'rounded' }); 49 | }); 50 | } 51 | } 52 | 53 | refreshEmployeeList() { 54 | this.employeeService.getEmployeeList().subscribe((res) => { 55 | this.employeeService.employees = res as Employee[]; 56 | }); 57 | } 58 | 59 | onEdit(emp: Employee) { 60 | this.employeeService.selectedEmployee = emp; 61 | } 62 | 63 | onDelete(_id: string, form: NgForm) { 64 | if (confirm('Are you sure to delete this record ?') == true) { 65 | this.employeeService.deleteEmployee(_id).subscribe((res) => { 66 | this.refreshEmployeeList(); 67 | this.resetForm(form); 68 | M.toast({ html: 'Deleted successfully', classes: 'rounded' }); 69 | }); 70 | } 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /AngularApp/src/app/shared/employee.model.ts: -------------------------------------------------------------------------------- 1 | export class Employee { 2 | _id: string; 3 | name: string; 4 | position: string; 5 | office: string; 6 | salary: number; 7 | } 8 | -------------------------------------------------------------------------------- /AngularApp/src/app/shared/employee.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { EmployeeService } from './employee.service'; 4 | 5 | describe('EmployeeService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [EmployeeService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([EmployeeService], (service: EmployeeService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /AngularApp/src/app/shared/employee.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { Observable } from 'rxjs/Observable'; 4 | import 'rxjs/add/operator/map'; 5 | import 'rxjs/add/operator/toPromise'; 6 | 7 | import { Employee } from './employee.model'; 8 | 9 | @Injectable() 10 | export class EmployeeService { 11 | selectedEmployee: Employee; 12 | employees: Employee[]; 13 | readonly baseURL = 'http://localhost:3000/employees'; 14 | 15 | constructor(private http: HttpClient) { } 16 | 17 | postEmployee(emp: Employee) { 18 | return this.http.post(this.baseURL, emp); 19 | } 20 | 21 | getEmployeeList() { 22 | return this.http.get(this.baseURL); 23 | } 24 | 25 | putEmployee(emp: Employee) { 26 | return this.http.put(this.baseURL + `/${emp._id}`, emp); 27 | } 28 | 29 | deleteEmployee(_id: string) { 30 | return this.http.delete(this.baseURL + `/${_id}`); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /AngularApp/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodAffection/MEAN-Stack-CRUD-Operations/9331498b756de0e86b4338c0dfc78d3dc3954b99/AngularApp/src/assets/.gitkeep -------------------------------------------------------------------------------- /AngularApp/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /AngularApp/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /AngularApp/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodAffection/MEAN-Stack-CRUD-Operations/9331498b756de0e86b4338c0dfc78d3dc3954b99/AngularApp/src/favicon.ico -------------------------------------------------------------------------------- /AngularApp/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AngularApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /AngularApp/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.log(err)); 13 | -------------------------------------------------------------------------------- /AngularApp/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/docs/ts/latest/guide/browser-support.html 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 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Required to support Web Animations `@angular/platform-browser/animations`. 51 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation 52 | **/ 53 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 54 | 55 | 56 | 57 | /*************************************************************************************************** 58 | * Zone JS is required by default for Angular itself. 59 | */ 60 | import 'zone.js/dist/zone'; // Included with Angular CLI. 61 | 62 | 63 | 64 | /*************************************************************************************************** 65 | * APPLICATION IMPORTS 66 | */ 67 | -------------------------------------------------------------------------------- /AngularApp/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | form div.input-field input{ 3 | padding-left: 15px !important; 4 | color: #25a297; 5 | } 6 | 7 | input.ng-invalid.ng-dirty{ 8 | border-bottom-color : #e91e63 !important; 9 | box-shadow: 0 1px 0 0 #e91e63 !important; 10 | } 11 | 12 | .input-field>label{ 13 | font-size: 1.2rem; 14 | font-weight: bold; 15 | } 16 | 17 | .btn-custom,.btn-custom:hover,.btn-custom:focus{ 18 | background-color: transparent; 19 | font-size: 1.1rem; 20 | margin : 0px 5px; 21 | border: #fff solid 1px ; 22 | text-transform:none; 23 | } 24 | 25 | div.card{ 26 | background-color : #083045; 27 | border-radius: 10px; 28 | } 29 | 30 | .vl { 31 | border-left: 2px solid #9e9e9e; 32 | height: 400px; 33 | } 34 | 35 | a.action-btn{ 36 | color: #9e9e9e ; 37 | margin: 0px 5px; 38 | 39 | } 40 | a.action-btn:hover{ 41 | cursor: pointer; 42 | } 43 | 44 | #toast-container { 45 | top: auto !important; 46 | right: auto !important; 47 | bottom: 10%; 48 | left:7%; 49 | } -------------------------------------------------------------------------------- /AngularApp/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 | -------------------------------------------------------------------------------- /AngularApp/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "module": "es2015", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /AngularApp/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "types": [ 8 | "jasmine", 9 | "node" 10 | ] 11 | }, 12 | "files": [ 13 | "test.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /AngularApp/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /AngularApp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "es5", 11 | "typeRoots": [ 12 | "node_modules/@types" 13 | ], 14 | "lib": [ 15 | "es2017", 16 | "dom" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /AngularApp/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", 22 | "rxjs/Rx" 23 | ], 24 | "import-spacing": true, 25 | "indent": [ 26 | true, 27 | "spaces" 28 | ], 29 | "interface-over-type-literal": true, 30 | "label-position": true, 31 | "max-line-length": [ 32 | true, 33 | 140 34 | ], 35 | "member-access": false, 36 | "member-ordering": [ 37 | true, 38 | { 39 | "order": [ 40 | "static-field", 41 | "instance-field", 42 | "static-method", 43 | "instance-method" 44 | ] 45 | } 46 | ], 47 | "no-arg": true, 48 | "no-bitwise": true, 49 | "no-console": [ 50 | true, 51 | "debug", 52 | "info", 53 | "time", 54 | "timeEnd", 55 | "trace" 56 | ], 57 | "no-construct": true, 58 | "no-debugger": true, 59 | "no-duplicate-super": true, 60 | "no-empty": false, 61 | "no-empty-interface": true, 62 | "no-eval": true, 63 | "no-inferrable-types": [ 64 | true, 65 | "ignore-params" 66 | ], 67 | "no-misused-new": true, 68 | "no-non-null-assertion": 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 | "directive-selector": [ 121 | true, 122 | "attribute", 123 | "app", 124 | "camelCase" 125 | ], 126 | "component-selector": [ 127 | true, 128 | "element", 129 | "app", 130 | "kebab-case" 131 | ], 132 | "no-output-on-prefix": true, 133 | "use-input-property-decorator": true, 134 | "use-output-property-decorator": true, 135 | "use-host-property-decorator": true, 136 | "no-input-rename": true, 137 | "no-output-rename": true, 138 | "use-life-cycle-interface": true, 139 | "use-pipe-transform-interface": true, 140 | "component-class-suffix": true, 141 | "directive-class-suffix": true 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /NodeJS/controllers/employeeController.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | var router = express.Router(); 3 | var ObjectId = require('mongoose').Types.ObjectId; 4 | 5 | var { Employee } = require('../models/employee'); 6 | 7 | // => localhost:3000/employees/ 8 | router.get('/', (req, res) => { 9 | Employee.find((err, docs) => { 10 | if (!err) { res.send(docs); } 11 | else { console.log('Error in Retriving Employees :' + JSON.stringify(err, undefined, 2)); } 12 | }); 13 | }); 14 | 15 | router.get('/:id', (req, res) => { 16 | if (!ObjectId.isValid(req.params.id)) 17 | return res.status(400).send(`No record with given id : ${req.params.id}`); 18 | 19 | Employee.findById(req.params.id, (err, doc) => { 20 | if (!err) { res.send(doc); } 21 | else { console.log('Error in Retriving Employee :' + JSON.stringify(err, undefined, 2)); } 22 | }); 23 | }); 24 | 25 | router.post('/', (req, res) => { 26 | var emp = new Employee({ 27 | name: req.body.name, 28 | position: req.body.position, 29 | office: req.body.office, 30 | salary: req.body.salary, 31 | }); 32 | emp.save((err, doc) => { 33 | if (!err) { res.send(doc); } 34 | else { console.log('Error in Employee Save :' + JSON.stringify(err, undefined, 2)); } 35 | }); 36 | }); 37 | 38 | router.put('/:id', (req, res) => { 39 | if (!ObjectId.isValid(req.params.id)) 40 | return res.status(400).send(`No record with given id : ${req.params.id}`); 41 | 42 | var emp = { 43 | name: req.body.name, 44 | position: req.body.position, 45 | office: req.body.office, 46 | salary: req.body.salary, 47 | }; 48 | Employee.findByIdAndUpdate(req.params.id, { $set: emp }, { new: true }, (err, doc) => { 49 | if (!err) { res.send(doc); } 50 | else { console.log('Error in Employee Update :' + JSON.stringify(err, undefined, 2)); } 51 | }); 52 | }); 53 | 54 | router.delete('/:id', (req, res) => { 55 | if (!ObjectId.isValid(req.params.id)) 56 | return res.status(400).send(`No record with given id : ${req.params.id}`); 57 | 58 | Employee.findByIdAndRemove(req.params.id, (err, doc) => { 59 | if (!err) { res.send(doc); } 60 | else { console.log('Error in Employee Delete :' + JSON.stringify(err, undefined, 2)); } 61 | }); 62 | }); 63 | 64 | module.exports = router; -------------------------------------------------------------------------------- /NodeJS/db.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | mongoose.connect('mongodb://localhost:27017/CrudDB', (err) => { 4 | if (!err) 5 | console.log('MongoDB connection succeeded.'); 6 | else 7 | console.log('Error in DB connection : ' + JSON.stringify(err, undefined, 2)); 8 | }); 9 | 10 | module.exports = mongoose; -------------------------------------------------------------------------------- /NodeJS/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const bodyParser = require('body-parser'); 3 | const cors = require('cors'); 4 | 5 | const { mongoose } = require('./db.js'); 6 | var employeeController = require('./controllers/employeeController.js'); 7 | 8 | var app = express(); 9 | app.use(bodyParser.json()); 10 | app.use(cors({ origin: 'http://localhost:4200' })); 11 | 12 | app.listen(3000, () => console.log('Server started at port : 3000')); 13 | 14 | 15 | app.use('/employees', employeeController); -------------------------------------------------------------------------------- /NodeJS/models/employee.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | var Employee = mongoose.model('Employee', { 4 | name: { type: String }, 5 | position: { type: String }, 6 | office: { type: String }, 7 | salary: { type: Number } 8 | }); 9 | 10 | module.exports = { Employee }; -------------------------------------------------------------------------------- /NodeJS/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodejs", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "accepts": { 8 | "version": "1.3.5", 9 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", 10 | "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", 11 | "requires": { 12 | "mime-types": "2.1.18", 13 | "negotiator": "0.6.1" 14 | } 15 | }, 16 | "array-flatten": { 17 | "version": "1.1.1", 18 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 19 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 20 | }, 21 | "async": { 22 | "version": "2.1.4", 23 | "resolved": "https://registry.npmjs.org/async/-/async-2.1.4.tgz", 24 | "integrity": "sha1-LSFgx3iAMuTdbL4lAvH5osj2zeQ=", 25 | "requires": { 26 | "lodash": "4.17.10" 27 | } 28 | }, 29 | "bluebird": { 30 | "version": "3.5.0", 31 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", 32 | "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=" 33 | }, 34 | "body-parser": { 35 | "version": "1.18.2", 36 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", 37 | "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", 38 | "requires": { 39 | "bytes": "3.0.0", 40 | "content-type": "1.0.4", 41 | "debug": "2.6.9", 42 | "depd": "1.1.2", 43 | "http-errors": "1.6.3", 44 | "iconv-lite": "0.4.19", 45 | "on-finished": "2.3.0", 46 | "qs": "6.5.1", 47 | "raw-body": "2.3.2", 48 | "type-is": "1.6.16" 49 | } 50 | }, 51 | "bson": { 52 | "version": "1.0.6", 53 | "resolved": "https://registry.npmjs.org/bson/-/bson-1.0.6.tgz", 54 | "integrity": "sha512-D8zmlb46xfuK2gGvKmUjIklQEouN2nQ0LEHHeZ/NoHM2LDiMk2EYzZ5Ntw/Urk+bgMDosOZxaRzXxvhI5TcAVQ==" 55 | }, 56 | "bytes": { 57 | "version": "3.0.0", 58 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", 59 | "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" 60 | }, 61 | "content-disposition": { 62 | "version": "0.5.2", 63 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", 64 | "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" 65 | }, 66 | "content-type": { 67 | "version": "1.0.4", 68 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 69 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 70 | }, 71 | "cookie": { 72 | "version": "0.3.1", 73 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", 74 | "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" 75 | }, 76 | "cookie-signature": { 77 | "version": "1.0.6", 78 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 79 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 80 | }, 81 | "cors": { 82 | "version": "2.8.4", 83 | "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz", 84 | "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", 85 | "requires": { 86 | "object-assign": "4.1.1", 87 | "vary": "1.1.2" 88 | } 89 | }, 90 | "debug": { 91 | "version": "2.6.9", 92 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 93 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 94 | "requires": { 95 | "ms": "2.0.0" 96 | } 97 | }, 98 | "depd": { 99 | "version": "1.1.2", 100 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 101 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 102 | }, 103 | "destroy": { 104 | "version": "1.0.4", 105 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 106 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 107 | }, 108 | "ee-first": { 109 | "version": "1.1.1", 110 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 111 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 112 | }, 113 | "encodeurl": { 114 | "version": "1.0.2", 115 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 116 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 117 | }, 118 | "escape-html": { 119 | "version": "1.0.3", 120 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 121 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 122 | }, 123 | "etag": { 124 | "version": "1.8.1", 125 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 126 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 127 | }, 128 | "express": { 129 | "version": "4.16.3", 130 | "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", 131 | "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", 132 | "requires": { 133 | "accepts": "1.3.5", 134 | "array-flatten": "1.1.1", 135 | "body-parser": "1.18.2", 136 | "content-disposition": "0.5.2", 137 | "content-type": "1.0.4", 138 | "cookie": "0.3.1", 139 | "cookie-signature": "1.0.6", 140 | "debug": "2.6.9", 141 | "depd": "1.1.2", 142 | "encodeurl": "1.0.2", 143 | "escape-html": "1.0.3", 144 | "etag": "1.8.1", 145 | "finalhandler": "1.1.1", 146 | "fresh": "0.5.2", 147 | "merge-descriptors": "1.0.1", 148 | "methods": "1.1.2", 149 | "on-finished": "2.3.0", 150 | "parseurl": "1.3.2", 151 | "path-to-regexp": "0.1.7", 152 | "proxy-addr": "2.0.3", 153 | "qs": "6.5.1", 154 | "range-parser": "1.2.0", 155 | "safe-buffer": "5.1.1", 156 | "send": "0.16.2", 157 | "serve-static": "1.13.2", 158 | "setprototypeof": "1.1.0", 159 | "statuses": "1.4.0", 160 | "type-is": "1.6.16", 161 | "utils-merge": "1.0.1", 162 | "vary": "1.1.2" 163 | }, 164 | "dependencies": { 165 | "statuses": { 166 | "version": "1.4.0", 167 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", 168 | "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" 169 | } 170 | } 171 | }, 172 | "finalhandler": { 173 | "version": "1.1.1", 174 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", 175 | "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", 176 | "requires": { 177 | "debug": "2.6.9", 178 | "encodeurl": "1.0.2", 179 | "escape-html": "1.0.3", 180 | "on-finished": "2.3.0", 181 | "parseurl": "1.3.2", 182 | "statuses": "1.4.0", 183 | "unpipe": "1.0.0" 184 | }, 185 | "dependencies": { 186 | "statuses": { 187 | "version": "1.4.0", 188 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", 189 | "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" 190 | } 191 | } 192 | }, 193 | "forwarded": { 194 | "version": "0.1.2", 195 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 196 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 197 | }, 198 | "fresh": { 199 | "version": "0.5.2", 200 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 201 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 202 | }, 203 | "http-errors": { 204 | "version": "1.6.3", 205 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", 206 | "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", 207 | "requires": { 208 | "depd": "1.1.2", 209 | "inherits": "2.0.3", 210 | "setprototypeof": "1.1.0", 211 | "statuses": "1.5.0" 212 | } 213 | }, 214 | "iconv-lite": { 215 | "version": "0.4.19", 216 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", 217 | "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" 218 | }, 219 | "inherits": { 220 | "version": "2.0.3", 221 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 222 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 223 | }, 224 | "ipaddr.js": { 225 | "version": "1.6.0", 226 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz", 227 | "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=" 228 | }, 229 | "kareem": { 230 | "version": "2.0.6", 231 | "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.0.6.tgz", 232 | "integrity": "sha512-/C+l8gABdHsAIfNpykJNWmYodpTnDRyn+JhORkP2VgEf1GgdAc+oTHjVADwISwCJKta031EOIwY6+Hki5z8SpQ==" 233 | }, 234 | "lodash": { 235 | "version": "4.17.10", 236 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", 237 | "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" 238 | }, 239 | "lodash.get": { 240 | "version": "4.4.2", 241 | "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", 242 | "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" 243 | }, 244 | "media-typer": { 245 | "version": "0.3.0", 246 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 247 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 248 | }, 249 | "merge-descriptors": { 250 | "version": "1.0.1", 251 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 252 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 253 | }, 254 | "methods": { 255 | "version": "1.1.2", 256 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 257 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 258 | }, 259 | "mime": { 260 | "version": "1.4.1", 261 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", 262 | "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" 263 | }, 264 | "mime-db": { 265 | "version": "1.33.0", 266 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", 267 | "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" 268 | }, 269 | "mime-types": { 270 | "version": "2.1.18", 271 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", 272 | "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", 273 | "requires": { 274 | "mime-db": "1.33.0" 275 | } 276 | }, 277 | "mongodb": { 278 | "version": "3.0.7", 279 | "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.0.7.tgz", 280 | "integrity": "sha512-n/14kMJEoARXz1qhpNPhUocqy+z5130jhqgEIX1Tsl8UVpHrndQ8et+VmgC4yPK/I8Tcgc93JEMQCHTekBUnNA==", 281 | "requires": { 282 | "mongodb-core": "3.0.7" 283 | } 284 | }, 285 | "mongodb-core": { 286 | "version": "3.0.7", 287 | "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.0.7.tgz", 288 | "integrity": "sha512-z6YufO7s40wLiv2ssFshqoLS4+Kf+huhHq6KZ7gDArsKNzXYjAwTMnhEIJ9GQ8fIfBGs5tBLNPfbIDoCKGPmOw==", 289 | "requires": { 290 | "bson": "1.0.6", 291 | "require_optional": "1.0.1" 292 | } 293 | }, 294 | "mongoose": { 295 | "version": "5.0.16", 296 | "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.0.16.tgz", 297 | "integrity": "sha512-GZqoN85gpk7+MTxZkE+yEVTtvvGfG5//X3UMWfbPQJhNO3nmmF4GFdE1qro73Vsn0PCchxyst3z55JpqZuYAZA==", 298 | "requires": { 299 | "async": "2.1.4", 300 | "bson": "1.0.6", 301 | "kareem": "2.0.6", 302 | "lodash.get": "4.4.2", 303 | "mongodb": "3.0.7", 304 | "mongoose-legacy-pluralize": "1.0.2", 305 | "mpath": "0.4.1", 306 | "mquery": "3.0.0", 307 | "ms": "2.0.0", 308 | "regexp-clone": "0.0.1", 309 | "sliced": "1.0.1" 310 | } 311 | }, 312 | "mongoose-legacy-pluralize": { 313 | "version": "1.0.2", 314 | "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", 315 | "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" 316 | }, 317 | "mpath": { 318 | "version": "0.4.1", 319 | "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.4.1.tgz", 320 | "integrity": "sha512-NNY/MpBkALb9jJmjpBlIi6GRoLveLUM0pJzgbp9vY9F7IQEb/HREC/nxrixechcQwd1NevOhJnWWV8QQQRE+OA==" 321 | }, 322 | "mquery": { 323 | "version": "3.0.0", 324 | "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.0.0.tgz", 325 | "integrity": "sha512-WL1Lk8v4l8VFSSwN3yCzY9TXw+fKVYKn6f+w86TRzOLSE8k1yTgGaLBPUByJQi8VcLbOdnUneFV/y3Kv874pnQ==", 326 | "requires": { 327 | "bluebird": "3.5.0", 328 | "debug": "2.6.9", 329 | "regexp-clone": "0.0.1", 330 | "sliced": "0.0.5" 331 | }, 332 | "dependencies": { 333 | "sliced": { 334 | "version": "0.0.5", 335 | "resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz", 336 | "integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8=" 337 | } 338 | } 339 | }, 340 | "ms": { 341 | "version": "2.0.0", 342 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 343 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 344 | }, 345 | "negotiator": { 346 | "version": "0.6.1", 347 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", 348 | "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" 349 | }, 350 | "object-assign": { 351 | "version": "4.1.1", 352 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 353 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 354 | }, 355 | "on-finished": { 356 | "version": "2.3.0", 357 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 358 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 359 | "requires": { 360 | "ee-first": "1.1.1" 361 | } 362 | }, 363 | "parseurl": { 364 | "version": "1.3.2", 365 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", 366 | "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" 367 | }, 368 | "path-to-regexp": { 369 | "version": "0.1.7", 370 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 371 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 372 | }, 373 | "proxy-addr": { 374 | "version": "2.0.3", 375 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz", 376 | "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", 377 | "requires": { 378 | "forwarded": "0.1.2", 379 | "ipaddr.js": "1.6.0" 380 | } 381 | }, 382 | "qs": { 383 | "version": "6.5.1", 384 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", 385 | "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" 386 | }, 387 | "range-parser": { 388 | "version": "1.2.0", 389 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", 390 | "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" 391 | }, 392 | "raw-body": { 393 | "version": "2.3.2", 394 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", 395 | "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", 396 | "requires": { 397 | "bytes": "3.0.0", 398 | "http-errors": "1.6.2", 399 | "iconv-lite": "0.4.19", 400 | "unpipe": "1.0.0" 401 | }, 402 | "dependencies": { 403 | "depd": { 404 | "version": "1.1.1", 405 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", 406 | "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" 407 | }, 408 | "http-errors": { 409 | "version": "1.6.2", 410 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", 411 | "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", 412 | "requires": { 413 | "depd": "1.1.1", 414 | "inherits": "2.0.3", 415 | "setprototypeof": "1.0.3", 416 | "statuses": "1.5.0" 417 | } 418 | }, 419 | "setprototypeof": { 420 | "version": "1.0.3", 421 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", 422 | "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" 423 | } 424 | } 425 | }, 426 | "regexp-clone": { 427 | "version": "0.0.1", 428 | "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", 429 | "integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk=" 430 | }, 431 | "require_optional": { 432 | "version": "1.0.1", 433 | "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", 434 | "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", 435 | "requires": { 436 | "resolve-from": "2.0.0", 437 | "semver": "5.5.0" 438 | } 439 | }, 440 | "resolve-from": { 441 | "version": "2.0.0", 442 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", 443 | "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" 444 | }, 445 | "safe-buffer": { 446 | "version": "5.1.1", 447 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", 448 | "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" 449 | }, 450 | "semver": { 451 | "version": "5.5.0", 452 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", 453 | "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" 454 | }, 455 | "send": { 456 | "version": "0.16.2", 457 | "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", 458 | "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", 459 | "requires": { 460 | "debug": "2.6.9", 461 | "depd": "1.1.2", 462 | "destroy": "1.0.4", 463 | "encodeurl": "1.0.2", 464 | "escape-html": "1.0.3", 465 | "etag": "1.8.1", 466 | "fresh": "0.5.2", 467 | "http-errors": "1.6.3", 468 | "mime": "1.4.1", 469 | "ms": "2.0.0", 470 | "on-finished": "2.3.0", 471 | "range-parser": "1.2.0", 472 | "statuses": "1.4.0" 473 | }, 474 | "dependencies": { 475 | "statuses": { 476 | "version": "1.4.0", 477 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", 478 | "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" 479 | } 480 | } 481 | }, 482 | "serve-static": { 483 | "version": "1.13.2", 484 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", 485 | "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", 486 | "requires": { 487 | "encodeurl": "1.0.2", 488 | "escape-html": "1.0.3", 489 | "parseurl": "1.3.2", 490 | "send": "0.16.2" 491 | } 492 | }, 493 | "setprototypeof": { 494 | "version": "1.1.0", 495 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", 496 | "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" 497 | }, 498 | "sliced": { 499 | "version": "1.0.1", 500 | "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", 501 | "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" 502 | }, 503 | "statuses": { 504 | "version": "1.5.0", 505 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 506 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" 507 | }, 508 | "type-is": { 509 | "version": "1.6.16", 510 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", 511 | "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", 512 | "requires": { 513 | "media-typer": "0.3.0", 514 | "mime-types": "2.1.18" 515 | } 516 | }, 517 | "unpipe": { 518 | "version": "1.0.0", 519 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 520 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 521 | }, 522 | "utils-merge": { 523 | "version": "1.0.1", 524 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 525 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 526 | }, 527 | "vary": { 528 | "version": "1.1.2", 529 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 530 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 531 | } 532 | } 533 | } 534 | -------------------------------------------------------------------------------- /NodeJS/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodejs", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "body-parser": "^1.18.2", 13 | "cors": "^2.8.4", 14 | "express": "^4.16.3", 15 | "mongoose": "^5.0.16" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MEAN Stack CRUD Operations for Beginners 2 | This is a MEAN Stack Demo Project Showing CRUD Operations Insert Update Delete and Read. 3 | 4 | ## Get the Code 5 | 6 | ``` 7 | $ git clone https://github.com/CodAffection/MEAN-Stack-CRUD-Operations.git 8 | $ cd MEAN-Stack-CRUD-Operations/AngularApp 9 | $ npm install 10 | ``` 11 | 12 | ## How it works ? 13 | 14 | :tv: Video tutorial on this same topic 15 | Url : https://youtu.be/UYh6EvpQquw 16 | 17 | Video Tutorial for MEAN Stack CRUD Operations 20 | 21 | 22 | ## Related MEAN Stack Tutorial in Order 23 | 1. CRUD Operation 24 | Insert Update View and Delete : https://goo.gl/LbQ4BM [_This One_] 25 | 2. User Registration
26 | Node JS Back End : https://goo.gl/CMnPwe
27 | Angular 6 Front End : https://goo.gl/xivk4x
28 | 3. JWT Authentication
29 | Node JS Back End : http://bit.ly/31FKEF6 30 | Angular Front End : http://bit.ly/2z6PmQ5 31 | 32 | 33 | | :bar_chart: | List of Tutorials | | :moneybag: | Support Us | 34 | |--------------------------:|:---------------------|---|---------------------:|:-------------------------------------| 35 | | Angular |http://bit.ly/2KQN9xF | |Paypal | https://goo.gl/bPcyXW | 36 | | Asp.Net Core |http://bit.ly/30fPDMg | |Amazon Affiliate | https://geni.us/JDzpE | 37 | | React |http://bit.ly/325temF | | 38 | | Python |http://bit.ly/2ws4utg | | :point_right: | Follow Us | 39 | | Node.js |https://goo.gl/viJcFs | |Website |http://www.codaffection.com | 40 | | Asp.Net MVC |https://goo.gl/gvjUJ7 | |YouTube |https://www.youtube.com/codaffection | 41 | | Flutter |https://bit.ly/3ggmmJz| |Facebook |https://www.facebook.com/codaffection | 42 | | Web API |https://goo.gl/itVayJ | |Twitter |https://twitter.com/CodAffection | 43 | | MEAN Stack |https://goo.gl/YJPPAH | | 44 | | C# Tutorial |https://goo.gl/s1zJxo | | 45 | | Asp.Net WebForm |https://goo.gl/GXC2aJ | | 46 | | C# WinForm |https://goo.gl/vHS9Hd | | 47 | | MS SQL |https://goo.gl/MLYS9e | | 48 | | Crystal Report |https://goo.gl/5Vou7t | | 49 | | CG Exercises in C Program |https://goo.gl/qEWJCs | | 50 | --------------------------------------------------------------------------------